messagingappbase/smartmessaging/vcalbc/src/VCalBcDataFiller.h
changeset 79 2981cb3aa489
parent 0 72b543305e3a
equal deleted inserted replaced
25:84d9eb65b26f 79:2981cb3aa489
       
     1 /*
       
     2 * Copyright (c) 2002 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 *     A helper class for filling the viewer component with data from a
       
    16 *     calendar item.
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 #ifndef __CVCALBCDATAFILLER_H_
       
    23 #define __CVCALBCDATAFILLER_H_
       
    24 
       
    25 // INCLUDES
       
    26 
       
    27 #include <e32base.h>
       
    28 #include <calrrule.h>
       
    29 
       
    30 // CONSTANTS
       
    31 // MACROS
       
    32 // DATA TYPES
       
    33 // FUNCTION PROTOTYPES
       
    34 
       
    35 // FORWARD DECLARATIONS
       
    36 
       
    37 class CCalEntry;
       
    38 class CRichBio;
       
    39 class CCoeEnv;
       
    40 
       
    41 // CLASS DECLARATION
       
    42 
       
    43 /**
       
    44  * A helper class for filling the viewer component with data from a
       
    45  * calendar item.
       
    46  */
       
    47 NONSHARABLE_CLASS( CVCalBcDataFiller ) : public CBase
       
    48     {
       
    49     public: // destruction
       
    50 
       
    51         /// destructor
       
    52         ~CVCalBcDataFiller();
       
    53 
       
    54     public: // new functions
       
    55 
       
    56         /**
       
    57          * Fills the viewer with data from the calendar item.
       
    58          * The parameter would have been const, but the Agenda API has some
       
    59          * functions which are not const for some reason.
       
    60          * @param aViewer Reference to the viewer.
       
    61          * @param aEntry Reference to the agenda entry
       
    62          * @param aCoeEnv Reference to CCoeEnv
       
    63          */
       
    64         static void FillViewerWithDataL(
       
    65             CRichBio& aViewer,
       
    66             CCalEntry& aEntry,
       
    67             CCoeEnv& aCoeEnv);
       
    68 
       
    69     private:
       
    70 
       
    71         /**
       
    72          * Fills the viewer with data from the calendar item.
       
    73          * The parameter would have been const, but the Agenda API has some
       
    74          * functions which are not const for some reason.
       
    75          * @param aViewer Reference to the viewer.
       
    76          */
       
    77         void FillViewerWithDataL(CRichBio& aViewer);
       
    78 
       
    79         /**
       
    80          * Adds anniversary specific info to the viewer.
       
    81          * @param aViewer Reference to the viewer.
       
    82          * @param aStartTime The start time from the entry.
       
    83          */
       
    84         void AddAnniversarySpecificInfoL(
       
    85             CRichBio& aViewer,
       
    86             const TTime& aStartTime);
       
    87 
       
    88         /**
       
    89          * Adds meeting specific info to the viewer.
       
    90          * @param aViewer Reference to the viewer.
       
    91          * @param aStartTime The start time from the entry.
       
    92          * @param aEndTime The start time from the entry.
       
    93          */
       
    94         void AddMeetingSpecificInfoL(
       
    95             CRichBio& aViewer,
       
    96             const TTime& aStartTime,
       
    97             const TTime& aEndTime);
       
    98 
       
    99         /**
       
   100          * Adds daynote specific info to the viewer.
       
   101          * @param aViewer Reference to the viewer.
       
   102          * @param aStartTime The start time from the entry.
       
   103          * @param aEndTime The start time from the entry.
       
   104          */
       
   105         void AddDaynoteSpecificInfoL(
       
   106             CRichBio& aViewer,
       
   107             const TTime& aStartTime,
       
   108             const TTime& aEndTime);
       
   109 
       
   110         /**
       
   111          * Adds vTodo specific info to the viewer.
       
   112          * @since Series S60 3.0
       
   113          * @param aViewer Reference to the viewer.
       
   114          * @return void
       
   115          */
       
   116         void AddVTodoSpecificInfoL(
       
   117         	CRichBio& aViewer);
       
   118 
       
   119         /**
       
   120          * Adds alarm informatin to the CRichBio viewer.
       
   121          * @param aViewer Reference to the viewer component.
       
   122          */
       
   123         void AddAlarmInfoL(
       
   124             CRichBio& aViewer);
       
   125 
       
   126         /**
       
   127          * Adds alarm repeat information to the CRichBio viewer
       
   128          * if text resource for the repeat value exists.
       
   129          * @param aViewer Reference to the viewer component.
       
   130          */
       
   131         void AddRepeatInfoL(CRichBio& aViewer);
       
   132 
       
   133         /**
       
   134          * Gives the text resource ID for a certain repeat index type.
       
   135          * @param aType Repeat index type.
       
   136          * @return Repeat value text resource.
       
   137          */
       
   138         TInt RepeatIndexValueTextRes(TCalRRule aRepeatRule ) const;
       
   139 
       
   140         /**
       
   141          * Adds confidentiality info.
       
   142          * @param aViewer Reference to the viewer component.
       
   143          */
       
   144         void AddConfidentialityInfoL(CRichBio& aViewer);
       
   145 
       
   146         /**
       
   147          * Adds calendar entry description info.
       
   148          * @param aViewer Reference to the viewer component.
       
   149          */
       
   150 		void AddDescriptionInfoL( CRichBio& aViewer );
       
   151 
       
   152         /**
       
   153          * Returns the rich text content from the entry as a HBufC.
       
   154          * @param aEntry Reference to the entry.
       
   155          * @return The text content.
       
   156          */
       
   157         HBufC* TextContentsFromEntryL(CCalEntry& aEntry);
       
   158 
       
   159         /**
       
   160          * Helper for adding to viewer.
       
   161          * @param aViewer Reference to the viewer control
       
   162          * @param aLabelRes Resource id for label
       
   163          * @param aValue Value text
       
   164          */
       
   165         void AddItemL(CRichBio& aViewer,
       
   166             TInt aLabelRes, const TDesC& aValue);
       
   167 
       
   168         /**
       
   169          * Helper for adding to viewer.
       
   170          * @param aViewer Reference to the viewer control
       
   171          * @param aLabelRes Resource id for label
       
   172          * @param aValueRes Resource id for value text
       
   173          */
       
   174         void AddItemL(CRichBio& aViewer,
       
   175             TInt aLabelRes, TInt aValueRes);
       
   176 
       
   177         /**
       
   178          * Adds a label and date to the viewer.
       
   179          * @param aViewer Reference to the CRichBio viewer.
       
   180          * @param aLabelRes Label text resource ID.
       
   181          * @param aTime TTime.
       
   182          */
       
   183         void AddItemAsDateL(CRichBio& aViewer,
       
   184             TInt aLabelRes,
       
   185             const TTime& aTime);
       
   186 
       
   187         /**
       
   188          * Adds a label and time to the viewer.
       
   189          * @param aViewer Reference to the CRichBio viewer.
       
   190          * @param aLabelRes Label text resource ID.
       
   191          * @param aTime TTime.
       
   192          */
       
   193         void AddItemAsTimeL(CRichBio& aViewer,
       
   194             TInt aLabelRes,
       
   195             const TTime& aTime);
       
   196 
       
   197        	/**
       
   198         * Adds a label and type to the viewer for vTodo entry
       
   199         * @since Series S60 3.0
       
   200         * @param aViewer Reference to the CRichBio viewer.
       
   201         * @return void
       
   202         */
       
   203 		void AddVTodoTypeInfoL(CRichBio& aViewer);
       
   204 
       
   205        	/**
       
   206         * Adds a label and subject to the viewer for vTodo entry
       
   207         * @since Series S60 3.0
       
   208         * @param aViewer Reference to the CRichBio viewer.
       
   209         * @return void
       
   210         */
       
   211 		void AddVTodoSubjectInfoL(CRichBio& aViewer);
       
   212 
       
   213        	/**
       
   214         * Adds a label and duedate to the viewer for vTodo entry
       
   215         * @since Series S60 3.0
       
   216         * @param aViewer Reference to the CRichBio viewer.
       
   217         * @return void
       
   218         */
       
   219 		void AddVTodoDueDateInfoL(CRichBio& aViewer);
       
   220 
       
   221        	/**
       
   222         * Adds a label and alarminfo to the viewer for vTodo entry
       
   223         * @since Series S60 3.0
       
   224         * @param aViewer Reference to the CRichBio viewer.
       
   225         * @return void
       
   226         */
       
   227 		void AddVTodoAlarmInfoL(CRichBio& aViewer);
       
   228 
       
   229        	/**
       
   230         * Adds a label and priority to the viewer for vTodo entry
       
   231         * @since Series S60 3.0
       
   232         * @param aViewer Reference to the CRichBio viewer.
       
   233         * @return void
       
   234         */
       
   235 		void AddVTodoPriorityInfoL(CRichBio& aViewer);
       
   236 
       
   237     private: // construction
       
   238 
       
   239         /**
       
   240          * Two phase constructor.
       
   241          * @param aEntry Reference to the agenda entry
       
   242          * @param aCoeEnv Reference to CCoeEnv
       
   243          */
       
   244         static CVCalBcDataFiller* NewLC(CCalEntry& aEntry, CCoeEnv& aCoeEnv);
       
   245 
       
   246         /**
       
   247          * Constructor
       
   248          * @param aEntry Reference to the agenda entry.
       
   249          */
       
   250         CVCalBcDataFiller(CCalEntry& aEntry, CCoeEnv& aCoeEnv);
       
   251 
       
   252         /// second phase constructor
       
   253         void ConstructL();
       
   254 
       
   255     private: //prohibited
       
   256 
       
   257         /// default constructor prohibited
       
   258         CVCalBcDataFiller();
       
   259 
       
   260         /// Copy contructor prohibited.
       
   261         CVCalBcDataFiller(const CVCalBcDataFiller& aSource);
       
   262 
       
   263         /// Assignment operator prohibited.
       
   264         const CVCalBcDataFiller& operator=(const CVCalBcDataFiller& aSource);
       
   265 
       
   266     private: // data
       
   267 
       
   268         CCoeEnv& iCoeEnv;
       
   269         CCalEntry& iEntry;
       
   270         HBufC* iDateFormat;
       
   271         HBufC* iTimeFormat;
       
   272         HBufC* iSummaryDescr;
       
   273     };
       
   274 
       
   275 #endif //__CVCALBCDATAFILLER_H_
       
   276 
       
   277 //end of file