00001 /* 00002 * ============================================================================ 00003 * Name : MsgBioControl.h 00004 * Part of : Smart Messaging / MsgEditorUtils 00005 * Description : Base class for bio controls. 00006 * Version : %version: e002sa09#12 % 00007 * 00008 * Copyright © 2002-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 */ 00018 00019 #ifndef MSGBIOCONTROL_H 00020 #define MSGBIOCONTROL_H 00021 00022 00023 // INCLUDES 00024 #include <msvstd.h> 00025 #include <coecntrl.h> // for CCoeControl 00026 #include <mmsgbiocontrol.h> // for MMsgBioControl 00027 #include <badesca.h> // for CDesCArray 00028 #include <aknglobalnote.h> 00029 #include <MsgEditor.hrh> // for TMsgCursorLocation 00030 00031 // FORWARD DECLARATIONS 00032 00033 class MMsgBioControlObserver; 00034 class CMsvSession; 00035 class MMsgBioControlExtension; 00036 00037 00038 // CLASS DECLARATION 00039 00043 class CMsgBioControl : public CCoeControl, public MMsgBioControl 00044 { 00045 00046 public: //construction and destruction 00047 00056 IMPORT_C CMsgBioControl( 00057 MMsgBioControlObserver& aObserver, 00058 CMsvSession* aSession, //ownership is NOT transferred 00059 TMsvId aId, 00060 TMsgBioMode aEditorOrViewerMode, 00061 const RFile* aFile); //ownership is NOT transferred 00062 00063 00067 IMPORT_C ~CMsgBioControl(); 00068 00069 public: // static helper functions 00070 00078 IMPORT_C static TBool ConfirmationQueryL(const TDesC& aText); 00079 00089 IMPORT_C static TBool ConfirmationQueryL(TInt aStringResource); 00090 00091 public: // from MMsgBioControl 00092 00105 IMPORT_C TUint32 OptionMenuPermissionsL() const; 00106 00112 IMPORT_C TInt VirtualHeight(); 00113 00119 IMPORT_C TInt VirtualVisibleTop(); 00120 00127 IMPORT_C TBool IsCursorLocation(TMsgCursorLocation aLocation) const; 00128 00129 public: //new functions 00130 00136 IMPORT_C TBool GetBioControlHelpContext(TCoeHelpContext& aContext) const; 00137 00138 00139 protected: //new functions 00140 00146 IMPORT_C TBool IsEditor() const; 00147 00152 IMPORT_C TBool IsFileBased() const; 00153 00160 IMPORT_C CMsvSession& MsvSession() const; 00161 00169 IMPORT_C const TFileName& FileName() const; 00170 00178 IMPORT_C const RFile& FileHandle() const; 00179 00187 IMPORT_C void LoadResourceL(const TDesC& aFile); 00188 00196 IMPORT_C void LoadResourceL(const TDesC& aFile, 00197 const TDesC& aSearchPath); 00198 00203 IMPORT_C void LoadStandardBioResourceL(); 00204 00213 IMPORT_C void AddMenuItemL(CEikMenuPane& aMenuPane, TInt aStringRes, 00214 TInt aCommandOffset, TInt aPosition = 0); 00215 00222 IMPORT_C TBool NotifyEditorViewL( 00223 TMsgBioControlEventRequest aRequest, 00224 TInt aDelta = 0); 00225 00226 00227 private: // new functions 00228 00234 void SetBioBodyControl( MMsgBioBodyControl* aBioBodyControl ); 00235 00237 TBool IsNear(TInt aLafPos, TInt aPos) const; 00238 00239 private: // not available 00240 00244 CMsgBioControl(); 00245 00249 CMsgBioControl(const CMsgBioControl& aSource); 00250 00254 const CMsgBioControl& operator=(const CMsgBioControl& aSource); 00255 00256 protected: 00257 00259 MMsgBioControlObserver& iBioControlObserver; 00260 00262 TMsvId iId; 00263 00264 private: 00265 00272 CMsvSession* iMsvSession; 00273 00275 TMsgBioMode iMode; 00276 00284 const RFile* iFile; 00285 00287 CArrayFixFlat<TInt>* iResourceOffsets; 00288 00290 MMsgBioBodyControl* iBioBodyControl; 00291 00293 TInt iBCStatusFlags; 00294 00295 private: 00296 00297 friend class CMsgBioBodyControl; 00298 00299 }; 00300 00301 // MSGBIOCONTROL_H 00302 #endif 00303 00304 // End of file