idlefw/plugins/devicestatus/inc/aidatepublisher.h
branchRCL_3
changeset 30 a5a39a295112
equal deleted inserted replaced
29:0efa10d348c0 30:a5a39a295112
       
     1 /*
       
     2 * Copyright (c) 2005-2006 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:  Date publisher
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_AIDATEPUBLISHER_H
       
    20 #define C_AIDATEPUBLISHER_H
       
    21 
       
    22 // System includes
       
    23 #include <e32base.h>
       
    24 #include <coemain.h>
       
    25 #include <aidevicestatuscontentmodel.h>
       
    26 
       
    27 // User includes
       
    28 #include "aidevicestatuspublisher.h"
       
    29 
       
    30 // Forward declarations
       
    31 class MAiDeviceStatusContentObserver;
       
    32 class CHsContentPublisher;
       
    33 class CEnvironmentChangeNotifier;
       
    34 
       
    35 /**
       
    36  *  @ingroup group_devicestatusplugin
       
    37  *
       
    38  *  Date publisher.
       
    39  *
       
    40  *  Publishes current date formatted according to current locale if profile
       
    41  *  if either general or offline.
       
    42  *
       
    43  *  @since S60 3.2
       
    44  */
       
    45 NONSHARABLE_CLASS( CAiDatePublisher ) : public CBase, 
       
    46     public MAiDeviceStatusPublisher
       
    47     {
       
    48 public:
       
    49 
       
    50     static CAiDatePublisher* NewL();
       
    51 
       
    52     virtual ~CAiDatePublisher();
       
    53 
       
    54 protected:
       
    55 
       
    56 // from base class MAiDeviceStatusPublisher
       
    57 
       
    58     void ResumeL();
       
    59     void Subscribe( MAiContentObserver& aObserver, 
       
    60                     CHsContentPublisher& aExtension,
       
    61                     MAiPublishPrioritizer& aPrioritizer,
       
    62                     MAiPublisherBroadcaster& aBroadcaster );
       
    63     void RefreshL( TBool aClean );
       
    64     TBool RefreshL( TInt aContentId, TBool aClean );
       
    65 
       
    66 private:
       
    67 
       
    68     CAiDatePublisher();
       
    69 
       
    70     void ConstructL();
       
    71 
       
    72 	/// Re-publish date
       
    73 	void RefreshDateL();
       
    74 	
       
    75 	/// Create day name string
       
    76 	HBufC* GetDayNameStringLC( TDay aDay, CCoeEnv& aCoeEnv );
       
    77 
       
    78 	/// Create date string
       
    79     HBufC* ConstructDateStringL();
       
    80     
       
    81     /// Callback when enviroment changed.
       
    82     static TInt HandleCallBackL( TAny *aPtr );
       
    83 
       
    84 
       
    85 
       
    86 protected: // data
       
    87 
       
    88     /**
       
    89      * Content observer.
       
    90      * Not own.
       
    91      */
       
    92     MAiContentObserver* iContentObserver;
       
    93 
       
    94     /**
       
    95      * Property extension.
       
    96      * Not own.
       
    97      */
       
    98     CHsContentPublisher* iExtension;
       
    99  
       
   100 	/**
       
   101 	 * Content prioritizer.
       
   102 	 * Not own.
       
   103 	 */
       
   104 	MAiPublishPrioritizer* iPrioritizer;
       
   105    
       
   106     /**
       
   107 	 * Environment notifier.
       
   108 	 * own.
       
   109 	 */
       
   110 	CEnvironmentChangeNotifier* iEnvNotifier;
       
   111 	
       
   112 	/**
       
   113 	 * Constructed date text.
       
   114 	 * Own.
       
   115 	 */
       
   116 	HBufC* iDateText;
       
   117 	
       
   118     };
       
   119 
       
   120 
       
   121 #endif // C_AIDATEPUBLISHER_H