webservices/wsnotifierplugins/inc/sennotplugindlgimpl.h
changeset 0 62f9d29f7211
equal deleted inserted replaced
-1:000000000000 0:62f9d29f7211
       
     1 /*
       
     2 * Copyright (c) 2002-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: Header declaration
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 #ifndef __SENNOTPLUGINDLGIMPL__
       
    26 #define __SENNOTPLUGINDLGIMPL__
       
    27 
       
    28 // INCLUDES
       
    29 #include <eiknotapi.h> // MEikSrvNotifierBase
       
    30 
       
    31 #include "sennotplugindlg.h"
       
    32 
       
    33 // FORWARD DECLARATIONS
       
    34 class CAknDialog;
       
    35 class TAuthenticationDlgRequest;
       
    36 class TAuthenticationDlgResponse;
       
    37 class TAllowRegisterDlgRequest;
       
    38 class TAllowRegisterDlgResponse;
       
    39 class TAllowUnRegisterDlgRequest;
       
    40 class TAllowUnRegisterDlgResponse;
       
    41 
       
    42 // CLASS DECLARATION
       
    43 #ifdef EKA2
       
    44 IMPORT_C CArrayPtr<MEikSrvNotifierBase2>* NotifierArray();
       
    45 class CSenNotPluginDlgImpl : public CActive, public MEikSrvNotifierBase2
       
    46 #else
       
    47 IMPORT_C CArrayPtr<MEikSrvNotifierBase>* NotifierArray();
       
    48 class CSenNotPluginDlgImpl : public CActive, public MEikSrvNotifierBase
       
    49 #endif
       
    50     {
       
    51     public: // Constructors and destructor
       
    52 
       
    53         static CSenNotPluginDlgImpl* NewL();
       
    54 
       
    55         ~CSenNotPluginDlgImpl();
       
    56 
       
    57         // Functions from base classes
       
    58 
       
    59         // From CActive
       
    60         void RunL();
       
    61         TInt RunError(TInt aError);
       
    62         void DoCancel();
       
    63 
       
    64         // From MEikSrvNotifierBase
       
    65         /**
       
    66         * Called when all resources allocated by notifiers shoudl be freed.
       
    67         */
       
    68         virtual void Release();
       
    69     
       
    70         /**
       
    71         * Called when a notifier is first loaded to allow any initial construction that is required.
       
    72         */
       
    73         #ifdef EKA2
       
    74             virtual MEikSrvNotifierBase2::TNotifierInfo RegisterL();
       
    75         #else
       
    76             virtual MEikSrvNotifierBase::TNotifierInfo RegisterL();
       
    77         #endif
       
    78         
       
    79         /**
       
    80         * @return the priority a notifier takes and the channels it acts on.  The return value may be varied
       
    81         * at run-time.
       
    82         */
       
    83         #ifdef EKA2
       
    84             virtual MEikSrvNotifierBase2::TNotifierInfo Info() const;
       
    85         #else
       
    86             virtual MEikSrvNotifierBase::TNotifierInfo Info() const;
       
    87         #endif
       
    88     
       
    89         /**
       
    90         * Start the notifier with data aBuffer and return an initial response.
       
    91         */
       
    92         virtual TPtrC8 StartL(const TDesC8& aBuffer);
       
    93     
       
    94         /**
       
    95         * Start the notifier with data aBuffer.  aMessage should be completed when the notifier is deactivated.
       
    96         * May be called multiple times if more than one client starts the notifier.  The notifier is immediately
       
    97         * responsible for completing aMessage.
       
    98         */
       
    99         #ifdef EKA2
       
   100             virtual void StartL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage);
       
   101         #else
       
   102             virtual void StartL(const TDesC8& aBuffer, const TAny* aReturnVal, RMessage aMessage);
       
   103         #endif
       
   104     
       
   105         /**
       
   106         * The notifier has been deactivated so resources can be freed and outstanding messages completed.
       
   107         */
       
   108         virtual void Cancel();
       
   109 
       
   110         /**
       
   111         * Update a currently active notifier with data aBuffer.
       
   112         */
       
   113         virtual TPtrC8 UpdateL(const TDesC8& aBuffer);
       
   114 
       
   115     private: 
       
   116         
       
   117         /**
       
   118         * C++ default constructor.
       
   119         */
       
   120         CSenNotPluginDlgImpl();
       
   121         
       
   122         /**
       
   123         * By default Symbian 2nd phase constructor is private.
       
   124         */
       
   125         void ConstructL();
       
   126 
       
   127         // New functions
       
   128 
       
   129         // Helpers
       
   130         void HandleAsyncRequestL();
       
   131         TInt ShowAuthenticationDialogL(TAuthenticationDlgRequest* aRequest,
       
   132                                        TAuthenticationDlgResponse* aResponse);
       
   133 
       
   134         TInt ShowAllowRegisterDialogL(TAllowRegisterDlgRequest* aRequest,
       
   135                                      TAllowRegisterDlgResponse* aResponse);
       
   136 
       
   137         TInt ShowAllowUnRegisterDialogL(TAllowUnRegisterDlgRequest* aRequest,
       
   138                                         TAllowUnRegisterDlgResponse* aResponse);
       
   139 
       
   140         TInt ShowAskSaveDialogL(TAskSaveDlgRequest* aRequest,
       
   141                                 TAskSaveDlgResponse* aResponse);
       
   142 
       
   143         void Cleanup();
       
   144 
       
   145     private: // Data
       
   146         TInt iMethod; // See TSenNotPluginRequest::TSenNotPluginMethod
       
   147         #ifdef EKA2
       
   148             RMessagePtr2    iMessage;
       
   149             TInt            iReplySlot;
       
   150             MEikSrvNotifierBase2::TNotifierInfo  iInfo;
       
   151         #else
       
   152             RMessage        iMessage;
       
   153             const TAny*     iReplyPtr;
       
   154             MEikSrvNotifierBase::TNotifierInfo  iInfo;
       
   155         #endif
       
   156         TPckgBuf<TSenNotPluginRequest>* iRequest;
       
   157         TPckgBuf<TSenNotPluginResponse>* iResponse;
       
   158         // Valid during showing a dialog
       
   159         CAknDialog* iDialog; 
       
   160         TBool iCancelled;
       
   161     };
       
   162 
       
   163 #endif // __SENNOTPLUGINDLGIMPL__
       
   164 
       
   165 // End of File