X2 Standard  Version 1.24
x2guiinterface.h
1 #ifndef _X2GUIInterface_H
2 #define _X2GUIInterface_H
3 
4 #define X2GUIInterface_Name "com.bisque.TheSkyX.X2GUIInterface/1.0"
5 
6 #ifdef THESKYX_FOLDER_TREE
7 #include "driverrootinterface.h"
8 #include "components/theskyxfacadefordrivers/theskyxfacadefordriversinterface.h"
9 #else
10 #include "../../licensedinterfaces/driverrootinterface.h"
11 #include "../../licensedinterfaces/theskyxfacadefordriversinterface.h"
12 #endif
13 
23 {
24 public:
25 
26  virtual ~X2GUIExchangeInterface (){}
27 
28 public:
30  virtual void setText(const char* pszObjectName, const char* pszValue) = 0;
32  virtual void text(const char* pszObjectName, char* pszOut, const int& nOutMaxSize) = 0;
33 
35  virtual void setEnabled(const char* pszObjectName, const bool& bEnabled) = 0;
37  virtual bool isEnabled(const char* pszObjectName) = 0;
38 
40  virtual void setCurrentIndex(const char* pszObjectName, const int & nValue) = 0;
42  virtual int currentIndex(const char* pszObjectName) = 0;
43 
45  virtual void setChecked(const char* pszObjectName, const int & nValue) = 0;
47  virtual int isChecked(const char* pszObjectName) = 0;
48 
50  virtual void comboBoxAppendString(const char* pszControlName, const char* pszValue) = 0;
51 
53  virtual void tableWidgetSetItem(const char* pszControlName, const int& nRow, const int& nCol, const char* pszValue) = 0;
55  virtual void tableWidgetGetItem(const char* pszControlName, const int& nRow, const int& nCol, char* pszValue, const int& nOutMaxSize) = 0;
57  virtual void tableWidgetCurrentRow(const char* pszControlName, int& nRow) = 0;
59  virtual void tableWidgetCurrentCol(const char* pszControlName, int& nCol) = 0;
61  virtual void tableWidgetRemoveRow(const char* pszControlName, const int& nRow) = 0;
63  virtual void tableWidgetRemoveCol(const char* pszControlName, const int& nCol) = 0;
64 
66  virtual void messageBox(const char* pszTitle, const char* pszMessage) = 0;
67 
69  virtual bool invokeMethod(const char* pszObjectName, const char* pszMethodName,
70  char* pszReturn=NULL, const int& nReturnMaxSize=0,
71  const char* pszArg1=NULL)=0;
72 
74  virtual void setPropertyString(const char* pszObjectName, const char* pszPropertyName, const char* pszValue) = 0;
76  virtual void propertyString(const char* pszObjectName, const char* pszPropertyName, char* pszOut, const int& nOutMaxSize) = 0;
77 
79  virtual void setPropertyInt(const char* pszObjectName, const char* pszPropertyName, const int & nValue) = 0;
81  virtual void propertyInt(const char* pszObjectName, const char* pszPropertyName, int& nValue) = 0;
82 
84  virtual void setPropertyDouble(const char* pszObjectName, const char* pszPropertyName, const double& dValue) = 0;
86  virtual void propertyDouble(const char* pszObjectName, const char* pszPropertyName, double& dValue) = 0;
87 };
88 
89 #define X2GUIEventInterface_Name "com.bisque.TheSkyX.X2GUIEventInterface/1.0"
90 
98 {
99 public:
100 
102  virtual void uiEvent(X2GUIExchangeInterface* uiex, const char* pszEvent)=0;
103 
104 };
105 
156 {
157 public:
158 
159  virtual ~X2GUIInterface(){}
160 
161 public:
162  //X2GUIInterface
163 
165  virtual int loadUserInterface(const char* pszFileName, const int& dt, const int& nISIndex)=0;
166 
169 
171  virtual int exec(bool& bPressedOK)=0;
172 
173 };
174 
187 {
188 
189 public:
192  {
193  m_pTheSkyX = pTheSkyX;
194  m_pX2UI = NULL;
195  m_pX2UIEvent = NULL;
196  if (pCaller)
197  pCaller->queryAbstraction(X2GUIEventInterface_Name, (void**)&m_pX2UIEvent);
198  X2UI();
199  }
200 
203  {
204  int nErr;
205 
206  if (NULL == m_pX2UI && m_pTheSkyX)
207  {
208  if ((nErr = m_pTheSkyX->doCommand(TheSkyXFacadeForDriversInterface::GET_X2UI, m_pX2UIEvent, &m_pX2UI)))
209  return NULL;
210  }
211  return m_pX2UI;
212  }
213 
216  {
217  if (NULL != m_pX2UI)
218  {
219  return m_pX2UI->X2DX();
220  }
221  return NULL;
222  }
223 
224  ~X2ModalUIUtil()
225  {
226  if (m_pTheSkyX)
227  {
228  if (m_pX2UI)
229  m_pTheSkyX->doCommand(TheSkyXFacadeForDriversInterface::UNGET_X2UI, NULL, &m_pX2UI);
230  }
231  }
232 
233 private:
235  X2GUIInterface* m_pX2UI;
236  X2GUIEventInterface* m_pX2UIEvent;
237 };
238 
239 #endif
X2GUIExchangeInterface::setChecked
virtual void setChecked(const char *pszObjectName, const int &nValue)=0
X2GUIExchangeInterface::tableWidgetRemoveRow
virtual void tableWidgetRemoveRow(const char *pszControlName, const int &nRow)=0
X2GUIExchangeInterface::text
virtual void text(const char *pszObjectName, char *pszOut, const int &nOutMaxSize)=0
X2ModalUIUtil::X2UI
X2GUIInterface * X2UI()
Definition: x2guiinterface.h:202
DriverRootInterface::queryAbstraction
virtual int queryAbstraction(const char *pszName, void **ppVal)=0
X2GUIEventInterface
The X2UIEventsInterface notifies X2 implementors when user interface events happen.
Definition: x2guiinterface.h:98
DriverRootInterface
The DriverRootInterface is the foundation for all X2 device drivers.
Definition: driverrootinterface.h:21
X2GUIExchangeInterface::isEnabled
virtual bool isEnabled(const char *pszObjectName)=0
X2GUIExchangeInterface::tableWidgetRemoveCol
virtual void tableWidgetRemoveCol(const char *pszControlName, const int &nCol)=0
X2GUIInterface
The X2GUIInterface allows X2 implementors to display a customized, cross platform,...
Definition: x2guiinterface.h:156
X2GUIInterface::loadUserInterface
virtual int loadUserInterface(const char *pszFileName, const int &dt, const int &nISIndex)=0
X2GUIExchangeInterface::propertyString
virtual void propertyString(const char *pszObjectName, const char *pszPropertyName, char *pszOut, const int &nOutMaxSize)=0
X2GUIExchangeInterface::propertyDouble
virtual void propertyDouble(const char *pszObjectName, const char *pszPropertyName, double &dValue)=0
X2GUIExchangeInterface::currentIndex
virtual int currentIndex(const char *pszObjectName)=0
X2GUIExchangeInterface::setPropertyString
virtual void setPropertyString(const char *pszObjectName, const char *pszPropertyName, const char *pszValue)=0
X2GUIExchangeInterface::setPropertyInt
virtual void setPropertyInt(const char *pszObjectName, const char *pszPropertyName, const int &nValue)=0
X2GUIExchangeInterface::propertyInt
virtual void propertyInt(const char *pszObjectName, const char *pszPropertyName, int &nValue)=0
TheSkyXFacadeForDriversInterface
The TheSkyXFacadeForDriversInterface is a simplified interface to TheSkyX passed to X2 implementors.
Definition: theskyxfacadefordriversinterface.h:19
X2GUIEventInterface::uiEvent
virtual void uiEvent(X2GUIExchangeInterface *uiex, const char *pszEvent)=0
X2ModalUIUtil::X2DX
X2GUIExchangeInterface * X2DX()
Definition: x2guiinterface.h:215
X2GUIExchangeInterface::setPropertyDouble
virtual void setPropertyDouble(const char *pszObjectName, const char *pszPropertyName, const double &dValue)=0
X2GUIExchangeInterface::isChecked
virtual int isChecked(const char *pszObjectName)=0
X2GUIExchangeInterface::tableWidgetCurrentRow
virtual void tableWidgetCurrentRow(const char *pszControlName, int &nRow)=0
X2GUIExchangeInterface::setEnabled
virtual void setEnabled(const char *pszObjectName, const bool &bEnabled)=0
X2GUIExchangeInterface::setCurrentIndex
virtual void setCurrentIndex(const char *pszObjectName, const int &nValue)=0
X2ModalUIUtil
The X2ModalUIUtil class supplies the X2 developer with the X2GUIInterface interface.
Definition: x2guiinterface.h:187
X2GUIExchangeInterface::tableWidgetCurrentCol
virtual void tableWidgetCurrentCol(const char *pszControlName, int &nCol)=0
X2GUIInterface::X2DX
virtual X2GUIExchangeInterface * X2DX()=0
TheSkyXFacadeForDriversInterface::doCommand
virtual int doCommand(const int &command, void *pIn, void *pOut) const =0
X2GUIExchangeInterface::invokeMethod
virtual bool invokeMethod(const char *pszObjectName, const char *pszMethodName, char *pszReturn=NULL, const int &nReturnMaxSize=0, const char *pszArg1=NULL)=0
X2GUIExchangeInterface::setText
virtual void setText(const char *pszObjectName, const char *pszValue)=0
X2GUIExchangeInterface::tableWidgetSetItem
virtual void tableWidgetSetItem(const char *pszControlName, const int &nRow, const int &nCol, const char *pszValue)=0
X2GUIExchangeInterface::messageBox
virtual void messageBox(const char *pszTitle, const char *pszMessage)=0
X2GUIInterface::exec
virtual int exec(bool &bPressedOK)=0
X2GUIExchangeInterface::tableWidgetGetItem
virtual void tableWidgetGetItem(const char *pszControlName, const int &nRow, const int &nCol, char *pszValue, const int &nOutMaxSize)=0
X2ModalUIUtil::X2ModalUIUtil
X2ModalUIUtil(DriverRootInterface *pCaller, TheSkyXFacadeForDriversInterface *pTheSkyX)
Definition: x2guiinterface.h:191
X2GUIExchangeInterface
The X2GUIExchangeInterface provides the X2 developer the means to get and set data from a graphical u...
Definition: x2guiinterface.h:23
X2GUIExchangeInterface::comboBoxAppendString
virtual void comboBoxAppendString(const char *pszControlName, const char *pszValue)=0
X2 Examples
(C) Software Bisque, Inc. All rights reserved.