00001 /* 00002 * ============================================================================ 00003 * Name : eikbutb.h 00004 * Part of : EikStd / EikCoCtl 00005 * Description : Base class for legacy Uikon buttons 00006 * Version : %version: 4 % 00007 * 00008 * Copyright © 2001-2006 Nokia. All rights reserved. 00009 * This material, including documentation and any related computer 00010 * programs, is protected by copyright controlled by Nokia. All 00011 * rights are reserved. Copying, including reproducing, storing, 00012 * adapting or translating, any or all of this material requires the 00013 * prior written consent of Nokia. This material also contains 00014 * confidential information which may not be disclosed to others 00015 * without the prior written consent of Nokia. 00016 * ============================================================================ 00017 * Template version: 4.1 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: // new functions 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: // new functions 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: // from CCoeControl 00175 IMPORT_C virtual void GetColorUseListL(CArrayFix<TCoeColorUse>& aColorUseList) const; 00176 00185 IMPORT_C virtual void HandleResourceChange(TInt aType); // not available before Release 005u 00186 00194 IMPORT_C void WriteInternalStateL(RWriteStream& aWriteStream) const; 00195 00196 private: // from CCoeControl 00197 IMPORT_C void Reserved_2(); 00198 00199 private: // new functions 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: // internal use only 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 // __EIKBUTB_H__ 00298 #endif