connectbar.h

00001 #ifndef CONTROL_BAR_H
00002 #define CONTROL_BAR_H
00003 
00004 #include <gui/layoutview.h>
00005 #include <gui/textview.h>
00006 #include <gui/stringview.h>
00007 #include <gui/dropdownmenu.h>
00008 #include <gui/button.h>
00009 #include <util/message.h>
00010 #include <util/string.h>
00011 
00012 
00021 class ConnectBar : public os::LayoutView
00022 {
00023 public:
00024         ConnectBar();
00025         
00026 public:
00027 
00031         os::String GetServerType()
00032         {
00033                 os::String result;
00034                 int selected = -1;
00035                 
00036                 if ( (selected = m_pcConnectionTypeDropdown->GetSelection()) >= 0 )
00037                 {
00038                         result = m_pcConnectionTypeDropdown->GetItem(selected);
00039                 }
00040 
00041                 return result;
00042         }
00043         
00044                 
00048         os::String GetHost()
00049         {
00050                 return m_pcHostText->GetBuffer()[0];
00051         }
00052         
00056         void SetHost(os::String zHost)
00057         {
00058                 m_pcHostText->SetValue(zHost);
00059         }
00060         
00064         os::String GetUser()
00065         {
00066                 return m_pcUserText->GetBuffer()[0];
00067         }
00068         
00072         void SetUser(os::String zUser)
00073         {
00074                 m_pcUserText->SetValue(zUser);
00075         }
00076 
00080         os::String GetPassword()
00081         {
00082                 return m_pcPassText->GetBuffer()[0];
00083         }
00084 
00088         void SetPass(os::String zPass)
00089         {
00090                 m_pcPassText->SetValue(zPass);
00091         }
00092 
00096         int GetPort()
00097         {
00098                 return atoi(m_pcPortText->GetBuffer()[0].c_str());
00099         }
00100 
00104         void SetPort(os::String zPort)
00105         {
00106                 m_pcPortText->SetValue(zPort);
00107         }
00108         
00109 private:
00110 
00111         void _Layout();
00112         
00113         
00114         //libsyllable functions
00115         os::Point GetPreferredSize(bool) const;
00116         void AllAttached();
00117 
00118 private:
00119         
00121         os::HLayoutNode* m_pcRoot;
00122 
00124         os::DropdownMenu* m_pcConnectionTypeDropdown;
00125         
00127         os::StringView* m_pcHostString;
00129         os::TextView* m_pcHostText;
00130         
00132         os::StringView* m_pcUserString;
00134         os::TextView* m_pcUserText;
00135         
00137         os::StringView* m_pcPassString;
00139         os::TextView* m_pcPassText;
00140         
00142         os::StringView* m_pcPortString;
00144         os::TextView* m_pcPortText;
00145         
00147         os::Button* m_pcButton;
00148 };
00149 
00150 #endif
00151 
00152 
00153 
00154 
00155 
00156 
00157 
00158 
00159 
00160 

Generated on Fri Jan 2 17:22:43 2009 for Transferrer by  doxygen 1.5.1