classicui_plat/extended_notifiers_api/inc/AknDialogController.h
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 2002-2008 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:  Notification dialog controller.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __AKNDIALOGCONTROLLER_H__
       
    20 #define __AKNDIALOGCONTROLLER_H__
       
    21 
       
    22 #include <e32std.h>
       
    23 #include <e32base.h>
       
    24 #include <aknnotedialog.h>
       
    25 
       
    26 class CAknGlobalNoteSubject;
       
    27 
       
    28 class MAknGlobalNoteController
       
    29     {
       
    30 public:
       
    31     virtual TInt AddSoftNotificationL(
       
    32         const TDesC& aText, 
       
    33         TInt aResource, 
       
    34         TInt aCount, 
       
    35         TInt aPriority, 
       
    36         TInt aSoftkeys, 
       
    37         TInt aTone = 0) = 0;
       
    38         
       
    39     virtual TInt AddNoteToQueueL(
       
    40         TInt aResourceId, 
       
    41         const TDesC& aText, 
       
    42         TInt aPriority, 
       
    43         CAknNoteDialog::TTimeout aTimeout, 
       
    44         CAknNoteDialog::TTone aDefaultTone, 
       
    45         TInt aUserTone, 
       
    46         TInt aGraphic, 
       
    47         TInt aGraphicMask, 
       
    48         TInt aAnimation, 
       
    49         TInt aSoftkeys = 0) = 0;
       
    50         
       
    51     virtual void TryDisplayNextNoteL(
       
    52         TBool aShowAsynch = EFalse) = 0;
       
    53         
       
    54     virtual void CancelNote(
       
    55         TInt aNoteId,
       
    56         TBool aShowNext = ETrue) = 0;
       
    57         
       
    58     virtual TInt DisplayAlarmL(
       
    59         TInt aType,
       
    60         const TDesC& aDescription,
       
    61         const TDesC& aTime) = 0;
       
    62         
       
    63     virtual void AddAlarmAdditionalInfo(  
       
    64         TInt aType,
       
    65         const TDesC& aTime,
       
    66         const TDesC& aDate,
       
    67         const TDesC& aSubject,
       
    68         const TDesC& aLocation) = 0;
       
    69     };
       
    70 
       
    71 class MSoftNotificationObserver
       
    72     {
       
    73 public:
       
    74     virtual void SoftNoteCompleted(TInt aId, TInt aCommand) = 0;
       
    75     virtual TBool ShowSoftNoteL(TInt aPriority, const TDesC& aText) = 0;
       
    76     virtual TBool CancelSoftNote(TInt aPriority) = 0;
       
    77     };
       
    78 
       
    79 class MNotifierDialogObserver
       
    80     {
       
    81 public:
       
    82     virtual void NoteCompleted(TInt aNoteId, TInt aCommand) = 0;
       
    83     virtual TBool DisplayDialogL(TInt aPriority) = 0;
       
    84     virtual TBool CancelDialog(TInt aPriority) = 0;
       
    85     };
       
    86 
       
    87 // For use by notifiers outside of Aknnotifyplugin2.DLL
       
    88 NONSHARABLE_CLASS(CNotifierDialogController) : public CBase, public MSoftNotificationObserver
       
    89     {
       
    90 public:
       
    91     CNotifierDialogController(MAknGlobalNoteController* aGlobalNoteNotifier); // not exported
       
    92     IMPORT_C void SetNoteObserver(MNotifierDialogObserver* aObserver);
       
    93     IMPORT_C TInt LaunchNoteL(TInt aNoteResource, TInt aSoftkeys, TInt aPriority);
       
    94     
       
    95     IMPORT_C TInt LaunchNoteL(
       
    96         TInt aResourceId, 
       
    97         TInt aSoftkeys, 
       
    98         TInt aPriority, 
       
    99         CAknNoteDialog::TTimeout aTimeout, 
       
   100         CAknNoteDialog::TTone aTone);
       
   101     
       
   102     IMPORT_C void CancelNote(TInt aNoteId);
       
   103     IMPORT_C TInt DisplayNonNoteDialogL(TInt aPriority);
       
   104     IMPORT_C TInt DisplayAlarmL(TInt aType, const TDesC& aDescription, const TDesC& aTime);
       
   105     
       
   106     IMPORT_C void AddAlarmAdditionalInfo( 
       
   107         TInt aType, // same as CAgnEntry::TType, use -1 for clock alarm
       
   108         const TDesC& aTime,
       
   109         const TDesC& aDate,
       
   110         const TDesC& aSubject,
       
   111         const TDesC& aLocation);
       
   112 
       
   113 private: // for now, will be public when system fully implemented
       
   114     // @Since 2.8 
       
   115     // Modules using this class should create own instance instead using Instance on EiksrvAppUI
       
   116     IMPORT_C static CNotifierDialogController* NewL(MAknGlobalNoteController* aGlobalNoteNotifier);
       
   117 
       
   118 private:
       
   119     // From MSoftNotificationObserver
       
   120     virtual void SoftNoteCompleted(TInt aId, TInt aCommand);
       
   121     virtual TBool ShowSoftNoteL(TInt aPriority, const TDesC& aText);
       
   122     virtual TBool CancelSoftNote(TInt aPriority);
       
   123 
       
   124 private:
       
   125     MAknGlobalNoteController* iGlobalNoteNotifier;
       
   126     MNotifierDialogObserver* iObserver;
       
   127     friend class CAknGlobalNoteSubject;
       
   128     friend class CEikServAppUi;
       
   129     };
       
   130 
       
   131  
       
   132 enum 
       
   133     {
       
   134     EClockAlarm        = 1,
       
   135     ECalendarAlarm     = 2,
       
   136     EHideSnooze        = 4,
       
   137     EClockAlarmStop    = 5, // binary EClockAlarm+EHideSnooze
       
   138     ECalendarAlarmStop = 6, // binary ECalendarAlarm+EHideSnooze
       
   139     EAskWakeUp         = 8,
       
   140     ENoSilence         = 16,
       
   141     EMskOpen           = 32
       
   142     };
       
   143 
       
   144 class MAknPhoneKeyForwarder
       
   145     {
       
   146 public:
       
   147     virtual void ForwardKeyToPhoneAppL(const TKeyEvent& aKeyEvent) = 0;
       
   148     };
       
   149 
       
   150 #endif // __AKNDIALOGCONTROLLER_H__