cellular/sssettings/inc/csssettingsactiveobject.h
author hgs
Tue, 10 Aug 2010 13:19:41 +0300
changeset 38 bc103bfb69cf
parent 33 8d5d7fcf9b59
permissions -rw-r--r--
201031_02
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
33
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2004-2005 Nokia Corporation and/or its subsidiary(-ies). 
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description:  Interface for Active object handling Publish and subscribe 
hgs
parents:
diff changeset
    15
*                notify events.
hgs
parents:
diff changeset
    16
*
hgs
parents:
diff changeset
    17
*/
hgs
parents:
diff changeset
    18
hgs
parents:
diff changeset
    19
hgs
parents:
diff changeset
    20
#ifndef CSSSETTINGSACTIVEOBJECT_H
hgs
parents:
diff changeset
    21
#define CSSSETTINGSACTIVEOBJECT_H
hgs
parents:
diff changeset
    22
hgs
parents:
diff changeset
    23
//  INCLUDES
hgs
parents:
diff changeset
    24
#include <e32base.h>
hgs
parents:
diff changeset
    25
#include <e32property.h>
hgs
parents:
diff changeset
    26
hgs
parents:
diff changeset
    27
hgs
parents:
diff changeset
    28
// CLASS DECLARATION
hgs
parents:
diff changeset
    29
hgs
parents:
diff changeset
    30
/**
hgs
parents:
diff changeset
    31
*  Interface for Publish and Subscribe notify.
hgs
parents:
diff changeset
    32
*
hgs
parents:
diff changeset
    33
*  @since   3.0
hgs
parents:
diff changeset
    34
*  @lib     SsSettings.lib
hgs
parents:
diff changeset
    35
*/
hgs
parents:
diff changeset
    36
class MSSSettingsPubSubNotify
hgs
parents:
diff changeset
    37
    {
hgs
parents:
diff changeset
    38
    public: // New functions
hgs
parents:
diff changeset
    39
    
hgs
parents:
diff changeset
    40
        virtual void HandlePubSubNotify(
hgs
parents:
diff changeset
    41
            const TUid aUid,
hgs
parents:
diff changeset
    42
            const TUint32 aKeyId ) = 0;
hgs
parents:
diff changeset
    43
    };
hgs
parents:
diff changeset
    44
hgs
parents:
diff changeset
    45
/**
hgs
parents:
diff changeset
    46
* Interface for Active object handling Publish and subscribe notify events.
hgs
parents:
diff changeset
    47
* @lib sssettings.lib
hgs
parents:
diff changeset
    48
* @since 3.0
hgs
parents:
diff changeset
    49
*/
hgs
parents:
diff changeset
    50
NONSHARABLE_CLASS( CSSSettingsActiveObject )
hgs
parents:
diff changeset
    51
    : public CActive
hgs
parents:
diff changeset
    52
    {
hgs
parents:
diff changeset
    53
    public:  // Constructors and destructor
hgs
parents:
diff changeset
    54
hgs
parents:
diff changeset
    55
        /**
hgs
parents:
diff changeset
    56
        * Two-phased constructor.
hgs
parents:
diff changeset
    57
        *
hgs
parents:
diff changeset
    58
        * @param aNotifyUid The Uid to be notified.
hgs
parents:
diff changeset
    59
        * @param aNotifyKey The key under aNotifyUid to be notified.
hgs
parents:
diff changeset
    60
        * @param aNotifyHandler The notifier to be informed about notify events.
hgs
parents:
diff changeset
    61
        * @return CSSSettingsActiveObject instance pointer.
hgs
parents:
diff changeset
    62
        */
hgs
parents:
diff changeset
    63
        static CSSSettingsActiveObject* NewL(
hgs
parents:
diff changeset
    64
            const TUid aNotifyUid,
hgs
parents:
diff changeset
    65
            const TUint32 aNotifyKey,
hgs
parents:
diff changeset
    66
            MSSSettingsPubSubNotify& aNotifyHandler );
hgs
parents:
diff changeset
    67
hgs
parents:
diff changeset
    68
hgs
parents:
diff changeset
    69
        /**
hgs
parents:
diff changeset
    70
        * Destructor.
hgs
parents:
diff changeset
    71
        */
hgs
parents:
diff changeset
    72
        virtual ~CSSSettingsActiveObject();
hgs
parents:
diff changeset
    73
hgs
parents:
diff changeset
    74
hgs
parents:
diff changeset
    75
    public: // New functions
hgs
parents:
diff changeset
    76
        
hgs
parents:
diff changeset
    77
        /**
hgs
parents:
diff changeset
    78
        * Starts the notify.
hgs
parents:
diff changeset
    79
        *
hgs
parents:
diff changeset
    80
        * @return Error code.
hgs
parents:
diff changeset
    81
        */
hgs
parents:
diff changeset
    82
        TInt NotifyKeyChange();
hgs
parents:
diff changeset
    83
hgs
parents:
diff changeset
    84
        /**
hgs
parents:
diff changeset
    85
        * Cancel notify
hgs
parents:
diff changeset
    86
        */
hgs
parents:
diff changeset
    87
        void CancelNotify();
hgs
parents:
diff changeset
    88
hgs
parents:
diff changeset
    89
hgs
parents:
diff changeset
    90
    protected:  // Functions from base classes
hgs
parents:
diff changeset
    91
        
hgs
parents:
diff changeset
    92
        /**
hgs
parents:
diff changeset
    93
        * From CActive.
hgs
parents:
diff changeset
    94
        */
hgs
parents:
diff changeset
    95
        void RunL();
hgs
parents:
diff changeset
    96
hgs
parents:
diff changeset
    97
        /**
hgs
parents:
diff changeset
    98
        * From CActive.
hgs
parents:
diff changeset
    99
        */
hgs
parents:
diff changeset
   100
        void DoCancel();
hgs
parents:
diff changeset
   101
        
hgs
parents:
diff changeset
   102
        
hgs
parents:
diff changeset
   103
    private:
hgs
parents:
diff changeset
   104
    
hgs
parents:
diff changeset
   105
        /**
hgs
parents:
diff changeset
   106
        * Constructor.
hgs
parents:
diff changeset
   107
        */
hgs
parents:
diff changeset
   108
        CSSSettingsActiveObject(
hgs
parents:
diff changeset
   109
            const TUid aNotifyUid,
hgs
parents:
diff changeset
   110
            const TUint32 aNotifyKey,
hgs
parents:
diff changeset
   111
            MSSSettingsPubSubNotify& aNotifyHandler );
hgs
parents:
diff changeset
   112
hgs
parents:
diff changeset
   113
        /**
hgs
parents:
diff changeset
   114
        * By default Symbian OS constructor is private.
hgs
parents:
diff changeset
   115
        */
hgs
parents:
diff changeset
   116
        void ConstructL();
hgs
parents:
diff changeset
   117
hgs
parents:
diff changeset
   118
hgs
parents:
diff changeset
   119
    private: // Data
hgs
parents:
diff changeset
   120
    
hgs
parents:
diff changeset
   121
        // Central Repository.
hgs
parents:
diff changeset
   122
        RProperty                iProperty;
hgs
parents:
diff changeset
   123
        
hgs
parents:
diff changeset
   124
        // Uid to be notified.
hgs
parents:
diff changeset
   125
        TUid                     iNotifyUid;
hgs
parents:
diff changeset
   126
        
hgs
parents:
diff changeset
   127
        // Key to be notified.
hgs
parents:
diff changeset
   128
        TUint32                  iNotifyKey;
hgs
parents:
diff changeset
   129
        
hgs
parents:
diff changeset
   130
        // Notify handler.
hgs
parents:
diff changeset
   131
        MSSSettingsPubSubNotify* iNotifyHandler;
hgs
parents:
diff changeset
   132
hgs
parents:
diff changeset
   133
        // The notify information.
hgs
parents:
diff changeset
   134
        TBool                    iNotify;
hgs
parents:
diff changeset
   135
    };
hgs
parents:
diff changeset
   136
hgs
parents:
diff changeset
   137
#endif // CSSSETTINGSACTIVEOBJECT_H
hgs
parents:
diff changeset
   138
            
hgs
parents:
diff changeset
   139
// End of File