00001 /* 00002 * Copyright (C) 2006, iRex Technologies B.V. 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2, or (at your option) 00007 * any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 */ 00018 00019 #ifndef CHANNELS_H_ 00020 #define CHANNELS_H_ 00021 00022 #include <liberipc/eripc.h> 00023 #include <liberipc/eripcbusyd.h> 00024 #include <liberipc/eripcpagebar.h> 00025 #include <liberipc/eripctoolbar.h> 00026 #include <liberdm/erdm.h> 00027 #include "goo/gtypes.h" 00028 #include <liberscribble/scb.h> 00029 00030 00032 // All channels used by iLiad: busy indicator, pagebar, ipc and toolbar 00034 #define PortraitToLandscape 90 00035 #define LandscapeToPortrait -90 00036 #define RotateDirty 0 00037 00038 class CChannels 00039 { 00040 public: 00041 erClientChannel_t erbusyChannel; 00042 erClientChannel_t erpagebarChannel; 00043 erClientChannel_t ertoolbarChannel; 00044 erServerChannel_t erIpcChannel; 00045 00046 private: 00047 // toolbar state, should use hash table. TBD 00048 int nPanState; 00049 int nZoominState; 00050 int nZoomoutState; 00051 int nRotateState; 00052 int nContinousState; 00053 int nZoombackState; 00054 int nBackwardState; 00055 int nForwardState; 00056 ScbDocPtr doc; // maintain scribble state 00057 GBool tbDirty; 00058 eDmQuality tbUpdateType; 00059 00060 // init all 00061 void initialize(); 00062 public: 00063 CChannels(); 00064 ~CChannels(); 00065 00067 void busy_blink(); 00068 void busy_on(); 00069 void busy_off(); 00070 00072 void pagebar_set_count(const int count); 00073 void pagebar_set_current_page(const int number); 00074 00076 GBool onReceiveToolbarMsg(const int iconID, const int state); 00077 void setPanState(const int state) { nPanState = state; } 00078 GBool isPanEnable() const { return iconState_selected == nPanState; } 00079 int getPanState() const { return nPanState; } 00080 void setZoomIn(const int state) { nZoominState = state; } 00081 GBool isZoomInEnable() const { return iconState_selected == nZoominState; } 00082 int getZoomInState() const { return nZoominState; } 00083 void setZoomOut(const int state) { nZoomoutState = state; } 00084 GBool isZoomOutEnable() const { return iconState_selected == nZoomoutState; } 00085 int getZoomOutState() const { return nZoomoutState; } 00086 void setRotateState(const int state) { nRotateState = state; } 00087 int getRotateState() const { return nRotateState; } 00088 void setContinousState(const int state) { nContinousState = state; } 00089 int getContinousState() const { return nContinousState; } 00090 void setZoombackState(const int state) { nZoombackState = state; } 00091 int getZoombackState() const { return nZoombackState; } 00092 int getBackwardState() const { return nBackwardState; } 00093 void setBackwardState(const int state) { nBackwardState = state; } 00094 int getForwardState() const { return nForwardState; } 00095 void setForwardState(const int state) { nForwardState = state; } 00096 00097 GBool isToolbarDirty() const { return tbDirty;} 00098 eDmQuality 00099 getToolbarUpdateType() const { return tbUpdateType; } 00100 void setToolbarDirty(GBool b = gTrue){ tbDirty = b; } 00101 void setToolbarUpdateType(const eDmQuality t = dmQTyping) { tbUpdateType = t;} 00102 void redrawToolbar(GBool bSync = gTrue); 00103 void popupKeyboard(GBool bPopup = gTrue); 00104 00106 void updateScribbleIcons(ScbDocPtr pDoc); 00107 void initScribbleState(ScbDocPtr pDoc); 00108 void onScribbleIconsClicked(const int iconID, const int state); 00109 void setScribbleNone(ScbDocPtr pDoc); 00110 00111 GBool isScribbleEnable() const { return (doc && doc->context.curState == SCB_TBS_SCRIBBLE); } 00112 GBool isEraseEnable() const { return (doc && doc->context.curState == SCB_TBS_ERASE); } 00113 GBool isScribbleIcon(const int id); 00114 }; 00115 00116 00117 #endif 00118