00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #if !defined(__EIKBUTB_H__)
00021 #define __EIKBUTB_H__
00022
00023 #if !defined(__EIKBCTRL_H__)
00024 #include <eikbctrl.h>
00025 #endif
00026
00027 #if !defined(__UIKON_HRH__)
00028 #include <uikon.hrh>
00029 #endif
00030
00031 #include <eikon.hrh>
00032
00033 #include <lafpublc.h>
00034
00035 class TEikButtonCoordinator;
00036
00040 enum TButtonBehavior
00041 {
00042 EEikButtonStaysClear=EEikButStaysClear,
00043 EEikButtonStaysSet=EEikButStaysSet,
00044 EEikButtonLatches=EEikButLatches,
00045 EEikButtonReportsOnPointerDown=EEikButReportOnPointerDown
00046 };
00047
00056 class CEikButtonBase : public CEikBorderedControl
00057 {
00058 public:
00062 IMPORT_C CEikButtonBase();
00063
00067 IMPORT_C ~CEikButtonBase();
00068
00069 public:
00070
00074 enum TState
00075 {
00076 EClear =0,
00077 ESet =1,
00078 EIndeterminate =2
00079 };
00080
00081 public:
00087 IMPORT_C TState State() const;
00088
00094 IMPORT_C void SetState(TState aState);
00095
00100 IMPORT_C virtual void Animate();
00101
00107 IMPORT_C void SetCoordinator(TEikButtonCoordinator* aButCoord);
00108
00114 IMPORT_C void SetBehavior(TButtonBehavior aBehavior);
00115
00119 IMPORT_C void SetIgnoreNextPointerUp();
00120
00121 protected:
00125 enum TDrawState
00126 {
00127 EDrawClear =SLafButtonBase::EDrawClear,
00128 EDrawSet =SLafButtonBase::EDrawSet,
00129 EDrawIndeterminate =SLafButtonBase::EDrawIndeterminate,
00130 EDrawClearPressed =SLafButtonBase::EDrawClearPressed,
00131 EDrawSetPressed =SLafButtonBase::EDrawSetPressed,
00132 EDrawIndeterminatePressed =SLafButtonBase::EDrawIndeterminatePressed
00133 };
00134
00135 protected:
00139 IMPORT_C void SetReportOnPointerDown();
00140
00146 IMPORT_C TDrawState DrawState() const;
00147
00153 IMPORT_C TBool IsPressed() const;
00154
00158 IMPORT_C void SetAllowTristate();
00159
00165 IMPORT_C void CopyDrawStateTo(CEikButtonBase* aTargetButton) const;
00166
00167 public:
00175 IMPORT_C virtual void GetColorUseListL(CArrayFix<TCoeColorUse>& aColorUseList) const;
00176
00185 IMPORT_C virtual void HandleResourceChange(TInt aType);
00186
00194 IMPORT_C void WriteInternalStateL(RWriteStream& aWriteStream) const;
00195
00196 private:
00197 IMPORT_C void Reserved_2();
00198
00199 private:
00203 IMPORT_C virtual void StateChanged();
00204 IMPORT_C virtual void Reserved_3();
00205
00206 public:
00214 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
00215
00225 IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
00226
00234 IMPORT_C TCoeInputCapabilities InputCapabilities() const;
00235
00236 private:
00242 IMPORT_C void* ExtensionInterface( TUid aInterface );
00243
00244 private:
00245 TBool ClickCompleted();
00246
00247 private:
00248 enum { EIgnoreNextPointerUp=0x1000 };
00249
00250 protected:
00254 TInt iButFlags;
00255
00256 private:
00260 TEikButtonCoordinator* iButCoord;
00261
00262 TInt iSpare[2];
00263 };
00264
00274 class TEikButtonCoordinator
00275 {
00276 public:
00280 IMPORT_C TEikButtonCoordinator();
00281
00288 IMPORT_C void SetChosenButton(CEikButtonBase* aChosenButton);
00289
00290 private:
00294 CEikButtonBase* iChosenButton;
00295 };
00296
00297
00298 #endif