meetingrequest/mrgui/inc/cesmrfieldbuilderinterface.h
branchRCL_3
changeset 25 3533d4323edc
equal deleted inserted replaced
24:d189ee25cf9d 25:3533d4323edc
       
     1 /*
       
     2 * Copyright (c) 2009 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:  Definition for GUI extension interface
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CESMRFIELDBUILDERINTERFACE_H
       
    20 #define CESMRFIELDBUILDERINTERFACE_H
       
    21 
       
    22 #include <ecom/ecom.h>
       
    23 
       
    24 #include "esmrinternaluid.h"
       
    25 #include "mesmrfieldvalidator.h"
       
    26 #include "tesmrentryfield.h"
       
    27 #include "mesmrresponseobserver.h"
       
    28 
       
    29 class CESMRField;
       
    30 
       
    31 /**
       
    32  *  MESMRFieldBuilder is the interface of the field builder composite.
       
    33  *  All field builder implementations will return only this
       
    34  */
       
    35 class MESMRFieldBuilder
       
    36     {
       
    37 public:
       
    38     /**
       
    39      * Creates editor field.
       
    40      *
       
    41      * @param aValidator - time validator
       
    42      * @param aField - field to be created
       
    43      */
       
    44     virtual CESMRField* CreateEditorFieldL(
       
    45             MESMRFieldValidator* aValidator,
       
    46             TESMREntryField aField ) = 0;
       
    47 
       
    48     /**
       
    49      * Creates viewer field.
       
    50      *
       
    51      * @param aResponseObserver - observer to be called when e.g.
       
    52      *                            answer is ready to be sent.
       
    53      * @param aField - field to be created
       
    54      * @param aResponseReady - NOT IN USE
       
    55      */
       
    56     virtual CESMRField* CreateViewerFieldL(
       
    57             MESMRResponseObserver* aResponseObserver,
       
    58             TESMREntryField aField,
       
    59             TBool aResponseReady ) = 0;
       
    60     };
       
    61 
       
    62 class MESMRBuilderExtension
       
    63     {
       
    64 public: // Destruction
       
    65     ~MESMRBuilderExtension() {}
       
    66 
       
    67 public:
       
    68     /**
       
    69      * Put additional flags/checks here if needed
       
    70      */
       
    71     enum TMRCFSMailBoxCapability
       
    72         {
       
    73         EMRCFSAttendeeStatus = 0,
       
    74         EMRCFSResponseDontSend,
       
    75         EMRCFSRemoveFromCalendar,
       
    76         EMRCFSSupportsAttachmentsInMR
       
    77         };
       
    78 
       
    79     /**
       
    80      * Check if a cfsmailboxflag is set
       
    81      */
       
    82     virtual TBool CFSMailBoxCapabilityL( TMRCFSMailBoxCapability aCapa ) = 0;
       
    83 
       
    84     /**
       
    85      * Check if a cfsmailboxflag is set
       
    86      */
       
    87     virtual TBool CFSMailBoxCapabilityL(
       
    88             const TDesC& aEmailAddress,
       
    89             TMRCFSMailBoxCapability aCapa ) = 0;
       
    90     
       
    91     /**
       
    92      * Checks, whenter meeting request can be originated or not.
       
    93      * @return ETrue, if MR can be originated, EFalse otherwise.
       
    94      */
       
    95     virtual TBool MRCanBeOriginateedL() = 0;
       
    96     };
       
    97 
       
    98 /**
       
    99  *  MESMRFieldBuilder is the interface of the field builder composite.
       
   100  *  All field builder implementations will return only this
       
   101  */
       
   102 class CESMRFieldBuilderInterface : public CBase
       
   103     {
       
   104 public:
       
   105     /**
       
   106      * Create specific implementation
       
   107      */
       
   108     inline static CESMRFieldBuilderInterface* CreatePluginL(
       
   109             TUid aImplementationUid );
       
   110 
       
   111     /**
       
   112      * Destructor
       
   113      */
       
   114     inline virtual ~CESMRFieldBuilderInterface();
       
   115 
       
   116     /**
       
   117      * return field builder to caller, implemented in all plugins
       
   118      */
       
   119     virtual MESMRFieldBuilder* FieldBuilderL() = 0;
       
   120 
       
   121     /**
       
   122      * extends the ecom interface
       
   123      */
       
   124     virtual TAny* ExtensionL( TUid aExtensionUid ) = 0;
       
   125 
       
   126 private:
       
   127     // The ECom destructor key identifier
       
   128     TUid iDestructorIdKey;
       
   129     };
       
   130 
       
   131 // -----------------------------------------------------------------------------
       
   132 // CESMRFieldBuilderInterface::CreatePluginL
       
   133 // -----------------------------------------------------------------------------
       
   134 //
       
   135 inline CESMRFieldBuilderInterface* CESMRFieldBuilderInterface::CreatePluginL(
       
   136         TUid aImplementationUid )
       
   137     {
       
   138     TAny* implementation =
       
   139         REComSession::CreateImplementationL( aImplementationUid,
       
   140                                              _FOFF( CESMRFieldBuilderInterface,
       
   141                                                     iDestructorIdKey ) );
       
   142     return reinterpret_cast<CESMRFieldBuilderInterface*>(implementation);
       
   143     }
       
   144 
       
   145 // -----------------------------------------------------------------------------
       
   146 // CESMRFieldBuilderInterface::~CESMRFieldBuilderInterface
       
   147 // -----------------------------------------------------------------------------
       
   148 //
       
   149 inline CESMRFieldBuilderInterface::~CESMRFieldBuilderInterface()
       
   150     {
       
   151     REComSession::DestroyedImplementation( iDestructorIdKey );
       
   152     }
       
   153 
       
   154 
       
   155 #endif // CESMRFIELDBUILDERINTERFACE_H