messagingappbase/smartmessaging/icalbc/src/CICalBC.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 /*
       
     2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  
       
    15 *     Bio control for iCalendar messages.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef CICALBC_H
       
    22 #define CICALBC_H
       
    23 
       
    24 // INCLUDES
       
    25 #include <coecobs.h>          // for MCoeControlObserver
       
    26 #include <eikbctrl.h>         // for CEikBorderedControl
       
    27 #include <msgbiocontrol.h>    // for CMsgBioControl
       
    28 #include <MMsgBioControlExtension.h> // for MMsgBioControlExtension
       
    29 
       
    30 #include <MMailAppUiInterface.h>
       
    31 #include <CMailMessageView.h>
       
    32 #include <MMailMessageView.h>
       
    33 
       
    34 // FORWARD DECLARATIONS
       
    35 class CEikStatusPane;
       
    36 class CMsvAttachment;
       
    37 class CMsgBaseControl;
       
    38 
       
    39 
       
    40 // CLASS DECLARATION
       
    41 
       
    42 /**
       
    43  * Bio control for Calendar messages.
       
    44  */
       
    45 class CICalendarBioControl: public CMsgBioControl,
       
    46                             public MMailAppUiInterface
       
    47     {
       
    48     public:
       
    49 
       
    50         /**
       
    51          * Two-phased constructor
       
    52          * @param aObserver Reference to the Bio control observer.
       
    53          * @param aSession Reference to Message Server session.
       
    54          * @param aId Id of the message.
       
    55          * @param aEditorOrViewerMode Flags the new Bio control as editor or viewer.
       
    56          * @param aFile filehandle.
       
    57          * @return The newly created object.
       
    58          */
       
    59         IMPORT_C static CMsgBioControl* NewL(
       
    60             MMsgBioControlObserver& aObserver,
       
    61             CMsvSession* aSession,
       
    62             TMsvId aId,
       
    63             TMsgBioMode aEditorOrViewerMode,
       
    64             const RFile* aFile );
       
    65 
       
    66          /// Destructor
       
    67         ~CICalendarBioControl();
       
    68 
       
    69     public: //from MMsgBioControl
       
    70 
       
    71         void SetAndGetSizeL(TSize& aSize);
       
    72         void SetMenuCommandSetL(CEikMenuPane& aMenuPane);
       
    73         TBool HandleBioCommandL(TInt aCommand);
       
    74         TRect CurrentLineRect() const;
       
    75         TBool IsFocusChangePossible(TMsgFocusDirection aDirection) const;
       
    76         HBufC* HeaderTextL(void) const;
       
    77         TInt VirtualHeight();
       
    78         TInt VirtualVisibleTop();
       
    79         TBool IsCursorLocation(TMsgCursorLocation aLocation) const;
       
    80 
       
    81     public: // from MMailMessageInterface
       
    82 		void AddAttachmentL( CMsvAttachment& aAttachmentInfo,
       
    83         	                 TBool aCanBeRemoved );
       
    84         void AddControlL(CCoeControl& aControl);
       
    85         //void AddControlL(CMsgBaseControl& aControl);
       
    86         void AddControlL(TInt aControlType);
       
    87         void AddControlL(MMailMsgBaseControl& aControl);
       
    88         CCoeControl& ParentControl();
       
    89         CEikStatusPane* StatusPane();
       
    90         void StartWaitNoteL(/*const TDesC& aText*/);
       
    91         void StopWaitNote();
       
    92         void SetTitleTextL(TInt aResourceId);
       
    93         void SetAddressFieldTextL(TInt aControlType, CDesCArray& aText);
       
    94         void SetAddressFieldTextL(TInt aControlType, TDesC& aText);
       
    95         void SetBodyTextL(CRichText& aText);
       
    96         void SetSubjectL(const TDesC& aText);
       
    97         TRect MsgViewRect(TInt aPane);
       
    98         void AppUiHandleCommandL(TInt aCommand);
       
    99         TBool IsNextMessageAvailableL( TBool aForward );
       
   100 		void NextMessageL( TBool aForward );
       
   101 
       
   102     protected: // from CCoeControl
       
   103 
       
   104         TInt CountComponentControls() const;
       
   105         CCoeControl* ComponentControl(TInt aIndex) const;
       
   106         void SizeChanged();
       
   107         void FocusChanged(TDrawNow aDrawNow);
       
   108         void SetContainerWindowL(const CCoeControl& aContainer);
       
   109         TKeyResponse OfferKeyEventL(
       
   110             const TKeyEvent& aKeyEvent,
       
   111             TEventCode aType);
       
   112 
       
   113     private: //new functions
       
   114 
       
   115 		/**
       
   116 		* Opens a read stream. Puts a stream cleanup (closing) item on the
       
   117 		* cleanup stack.
       
   118 		* @param aStream The stream that is to be opened.
       
   119 		* @param aFile File handle from which the stream is to be opened.
       
   120 		*/
       
   121 		void OpenStreamLC(RFileReadStream& aStream,
       
   122     		TFileName& aFileName);
       
   123 
       
   124         /**
       
   125          * This is needed because the menuPane adding is done in a different
       
   126          * way in BVA than in SMS Editor/Viewer.
       
   127          * @param aMenuPane Reference to the menu pane.
       
   128          * @param aStringRes String resource ID of the command text.
       
   129          * @param aCommandOffset Offset in the Options list.
       
   130          */
       
   131         void FileBasedAddMenuItemL(CEikMenuPane& aMenuPane,
       
   132             TInt aStringRes, TInt aCommandOffset);
       
   133 
       
   134     private: //construction
       
   135 
       
   136         /**
       
   137          * The constructor.
       
   138          * @param aObserver MMsgBioControlObserver
       
   139          * @param aSession CMsvSession, the Message Server session.
       
   140          * @param aId Id of the message in Message Server.
       
   141          * @param aEditorOrViewerMode Flags the control as being either editor or viewer
       
   142          * @param aFile filehandle.
       
   143          */
       
   144         CICalendarBioControl(
       
   145             MMsgBioControlObserver& aObserver,
       
   146             CMsvSession* aSession,
       
   147             TMsvId aId,
       
   148             TMsgBioMode aEditorOrViewerMode,
       
   149             const RFile* aFile );
       
   150 
       
   151         /// Second phase constructor.
       
   152         void ConstructL();
       
   153 
       
   154     private:
       
   155 
       
   156         TBool iIsFileBased;
       
   157         /// The viewer control
       
   158         CCoeControl* iViewer;
       
   159         CCoeControl* iParentControl;
       
   160         MMailMessageView* iICalContainer;
       
   161         RFileReadStream iVCalStream;
       
   162         TDesC* iResourceFile;
       
   163         TInt iTitleResourceID;
       
   164 
       
   165     };
       
   166 
       
   167 
       
   168 #endif // CICALBC_H
       
   169 
       
   170 // End of file