msgbiocontrol.h

Go to the documentation of this file.
00001 /*
00002 * ============================================================================
00003 *  Name        : MsgBioControl.h
00004 *  Part of     : Smart Messaging / MsgEditorUtils
00005 *  Description : Base class for bio controls.
00006 *  Version     : %version: 1 %
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 
00066         IMPORT_C ~CMsgBioControl();
00067 
00068     public: // static helper functions
00069 
00077         IMPORT_C static TBool ConfirmationQueryL(const TDesC& aText);
00078 
00088         IMPORT_C static TBool ConfirmationQueryL(TInt aStringResource);
00089 
00090     public: // from MMsgBioControl
00091 
00104         IMPORT_C TUint32 OptionMenuPermissionsL() const;
00105 
00111         IMPORT_C TInt VirtualHeight();
00112 
00118         IMPORT_C TInt VirtualVisibleTop();
00119 
00126         IMPORT_C TBool IsCursorLocation(TMsgCursorLocation aLocation) const;
00127     
00128     public: //new functions
00129     
00140         IMPORT_C TInt ScrollL( TInt aPixelsToScroll, TMsgScrollDirection aDirection );
00141 
00148         IMPORT_C void NotifyViewEvent( TMsgViewEvent aEvent, TInt aParam );
00149 
00150 
00151     protected: //new functions
00152 
00158         IMPORT_C TBool IsEditor() const;
00159 
00164         IMPORT_C TBool IsFileBased() const;
00165 
00172         IMPORT_C CMsvSession& MsvSession() const;
00173 
00181         IMPORT_C const TFileName& FileName() const;
00182 
00190         IMPORT_C const RFile& FileHandle() const;
00191 
00199         IMPORT_C void LoadResourceL(const TDesC& aFile);
00200 
00208         IMPORT_C void LoadResourceL(const TDesC& aFile,
00209             const TDesC& aSearchPath);
00210 
00215         IMPORT_C void LoadStandardBioResourceL();
00216 
00225         IMPORT_C void AddMenuItemL(CEikMenuPane& aMenuPane, TInt aStringRes,
00226             TInt aCommandOffset, TInt aPosition = 0);
00227 
00234         IMPORT_C TBool NotifyEditorViewL( 
00235             TMsgBioControlEventRequest aRequest,
00236             TInt aDelta = 0);
00237 
00242         IMPORT_C void SetExtension(MMsgBioControlExtension* aExt);    
00243 
00244 
00245     private: // new functions
00246 
00252         void SetBioBodyControl( MMsgBioBodyControl* aBioBodyControl );
00253 
00255         TBool IsNear(TInt aLafPos, TInt aPos) const;
00256 
00257     private: // not available
00258 
00262         CMsgBioControl();
00263 
00267         CMsgBioControl(const CMsgBioControl& aSource);
00268 
00272         const CMsgBioControl& operator=(const CMsgBioControl& aSource);
00273 
00274     protected:
00275 
00277         MMsgBioControlObserver& iBioControlObserver;
00278 
00280         TMsvId          iId;
00281 
00282     private:
00283 
00290         CMsvSession*    iMsvSession;
00291 
00293         TMsgBioMode iMode;
00294 
00302                 const RFile* iFile;
00303                 
00307         MMsgBioControlExtension* iExt;
00308 
00309         // Filler needed to keep this object's size the same.
00310         // Let the compiler calculate the filler size needed using sizeof.
00311         TUint8 iBCFiller[sizeof(TFileName) - sizeof(TFileName*) - sizeof(MMsgBioControlExtension*)];
00312         
00313 
00315         CArrayFixFlat<TInt>* iResourceOffsets;
00316 
00318         MMsgBioBodyControl* iBioBodyControl;
00319         
00321         TInt iBCStatusFlags;
00322 
00323     private:
00324 
00325         friend class CMsgBioBodyControl;
00326 
00327         };
00328 
00329 // MSGBIOCONTROL_H
00330 #endif
00331 
00332 // End of file

Copyright © Nokia Corporation 2001-2008
Back to top