calendarui/editors/inc/CalenDescription.h
branchRCL_3
changeset 66 bd7edf625bdd
child 67 1539a383d7b6
equal deleted inserted replaced
65:12af337248b1 66:bd7edf625bdd
       
     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:  ?Description
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CALENDESCRIPTION_H
       
    20 #define CALENDESCRIPTION_H
       
    21 
       
    22 // system includes
       
    23 #include <e32base.h>
       
    24 #include <eikfctry.h> // for SEikControlInfo 
       
    25 
       
    26 // forward declaration
       
    27 class CEikMenuPane;
       
    28 class CCalEntry;
       
    29 class CCalenDescriptionField;
       
    30 class CCalenUnifiedEditor;
       
    31 
       
    32 // CLASS DECLARATION
       
    33 
       
    34 /**
       
    35  *  ?one_line_short_description.
       
    36  *  ?other_description_lines
       
    37  *
       
    38  *  @lib ?library
       
    39  *  @since ?Series60_version
       
    40  */
       
    41 NONSHARABLE_CLASS( CCalenDescription ) : public CBase
       
    42     {
       
    43 public:  // Constructors and destructor
       
    44 
       
    45     /**
       
    46      * @brief Two-phased constructor.
       
    47      * @param aEditor referance to CCalenUnifiedEditor
       
    48      */
       
    49     static CCalenDescription* NewL(CCalenUnifiedEditor& aEditor);
       
    50 
       
    51     /**
       
    52      * @brief Destructor.
       
    53      */
       
    54     virtual ~CCalenDescription();
       
    55 
       
    56 public: // Options-menu API 
       
    57     /**
       
    58      * @brief Dynamic initialisation of menu pane 
       
    59      * @param aResourceId for reading menu from resource file
       
    60      * @param aMenuPane pointer to CEikMenuPane
       
    61      */
       
    62     void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane);
       
    63 
       
    64     /**
       
    65      * @brief processes the command id
       
    66      * @param aCommandId
       
    67      * @return ETrue if command is processed
       
    68      */
       
    69     TBool ProcessCommandL(TInt aCommandId);
       
    70 
       
    71 public: // Form Layout API
       
    72     /**
       
    73      * @brief Create description field
       
    74      * @return SEikControlInfo
       
    75      */
       
    76     SEikControlInfo CreateFieldL();
       
    77 
       
    78     /**
       
    79      * @brief Postlayout call back handleing
       
    80      */
       
    81     void PostLayoutDynInitL();
       
    82 
       
    83     /**
       
    84      * @brief Updates fields just before the form is shown.
       
    85      */
       
    86     void InitDescritpionFieldLayoutL();
       
    87 
       
    88 public:
       
    89     
       
    90     /**
       
    91      * @brief Check wehether descrition field edited or not
       
    92      * @return ETrue if descripion field is edited.
       
    93      */
       
    94     TBool IsEditedL() const;
       
    95 
       
    96 public: // Own API 
       
    97     /**
       
    98      * @brief Add new descrition
       
    99      */
       
   100     void AddNewL();
       
   101     
       
   102     /**
       
   103      * @brief Add memo to description field
       
   104      */
       
   105     void AddMemoL();
       
   106     
       
   107     /**
       
   108      * @brief Show description
       
   109      */
       
   110     void ShowL();
       
   111     
       
   112     /**
       
   113      * @brief Remove description
       
   114      */
       
   115     void RemoveL();
       
   116     
       
   117     /**
       
   118      * @brief edit description
       
   119      */
       
   120     void EditL();
       
   121 
       
   122 private:
       
   123     /**
       
   124      * @brief show the description field
       
   125      */
       
   126     void ShowFieldL();
       
   127     
       
   128     /**
       
   129      * @brief Hide description field
       
   130      */
       
   131     void HideFieldL();
       
   132     
       
   133     /**
       
   134      * @brief Get pointer to calen description field
       
   135      * @return CCalenDescriptionField
       
   136      */
       
   137     CCalenDescriptionField* Field();
       
   138     
       
   139     /**
       
   140      * @brief check if Description field visible
       
   141      * @return ETrue if field is visible
       
   142      */
       
   143     TBool IsFieldVisible();
       
   144 
       
   145     /**
       
   146      * @brief check if Description field focused
       
   147      * @return ETrue if field is focused
       
   148      */
       
   149     TBool IsFieldFocused();
       
   150 
       
   151     /**
       
   152      * @brief remove the description field
       
   153      */
       
   154     void DoRemoveL();
       
   155 
       
   156     /**
       
   157      * @brief Handle addition of description
       
   158      * @param aStatus
       
   159      * @param aDescription
       
   160      */
       
   161     void HandleAddL(TInt aStatus, HBufC* aDescription);
       
   162  
       
   163     /**
       
   164      * @brief Handle update of description
       
   165      * @param aStatus
       
   166      * @param aDescription
       
   167      */
       
   168     void HandleUpdateL(TInt aStatus, HBufC* aDescription);
       
   169 
       
   170     /**
       
   171      * @brief Open the notepad editor to allow editing of the description.
       
   172      * @param aStatus
       
   173      * @param aDescription
       
   174      */
       
   175     HBufC* ExecTextEditorL(TInt& aStatus, const TDesC& aDescription);
       
   176  
       
   177     /**
       
   178      * @brief Open the notepad viewer to allow viewing of the description.
       
   179      * @param aStatus
       
   180      * @param aDescription
       
   181      */
       
   182     HBufC* ExecTextViewerL(TInt& aStatus, const TDesC& aDescription);
       
   183     
       
   184     /**
       
   185      * Handles ECalenCmdAddDescription command 
       
   186      */
       
   187     TBool HandleAddDescriptionL();
       
   188     
       
   189         
       
   190 private:
       
   191     
       
   192     /**
       
   193      * @brief To check entry has description
       
   194      * @return ETrue of entry has description else EFalse
       
   195      */
       
   196     TBool EntryHasDescription() const;
       
   197 
       
   198 private:
       
   199 
       
   200     /**
       
   201      * @brief C++ default constructor.
       
   202      */
       
   203     CCalenDescription(CCalenUnifiedEditor& iEditor);
       
   204 
       
   205     /**
       
   206      * @brief By default Symbian 2nd phase constructor is private.
       
   207      */
       
   208     void ConstructL();
       
   209 
       
   210 private:    // Data
       
   211     /**
       
   212      * @var iEditor
       
   213      * @brief Reference to CCalenUnifiedEditor. It is used to insert lines.
       
   214      */
       
   215     CCalenUnifiedEditor& iEditor;
       
   216 
       
   217     };
       
   218 
       
   219 #endif      // CALENDESCRIPTION_H
       
   220 
       
   221 
       
   222 // End of File