epoc32/include/mw/eikbgfty.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@2
     1
/*
williamr@2
     2
* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     3
* All rights reserved.
williamr@2
     4
* This component and the accompanying materials are made available
williamr@4
     5
* under the terms of "Eclipse Public License v1.0"
williamr@2
     6
* which accompanies this distribution, and is available
williamr@4
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@2
     8
*
williamr@2
     9
* Initial Contributors:
williamr@2
    10
* Nokia Corporation - initial contribution.
williamr@2
    11
*
williamr@2
    12
* Contributors:
williamr@2
    13
*
williamr@2
    14
* Description:  Button group factory interface definitions.
williamr@2
    15
*
williamr@2
    16
*/
williamr@2
    17
williamr@2
    18
williamr@2
    19
#ifndef __EIKBGFTY_H__
williamr@2
    20
#define __EIKBGFTY_H__
williamr@2
    21
williamr@2
    22
#include <eikbtgpc.h>
williamr@2
    23
#include <coemain.h>
williamr@2
    24
williamr@2
    25
/**
williamr@2
    26
 * The EikButtonGroupFactory class provides an interface to the button group factory.
williamr@2
    27
 *
williamr@2
    28
 * @lib eikcoctl.lib
williamr@2
    29
 * @since S60 0.9
williamr@2
    30
 */ 
williamr@2
    31
class EikButtonGroupFactory
williamr@2
    32
    {
williamr@2
    33
public:
williamr@2
    34
    /**
williamr@2
    35
     * Defines information required to create a button group.
williamr@2
    36
     *
williamr@2
    37
     * @lib eikcoctl.lib
williamr@2
    38
     */
williamr@2
    39
    class TCreationData
williamr@2
    40
        {
williamr@2
    41
    public:
williamr@2
    42
        /**
williamr@2
    43
         * Constructor taking arguments required to create a button group.
williamr@2
    44
         *
williamr@2
    45
         * @param aUse The type of button group container.
williamr@2
    46
         * @param aCommandObserver A command observer to be notified of commands on the container.
williamr@2
    47
         * @param aResourceId A resource containing descriptions of buttons in the group. 
williamr@2
    48
         *                    This can be NULL if buttons are to be added dynamically. 
williamr@2
    49
         * @param aParentWg Parent window group.
williamr@2
    50
         * @param aFlags The button group's flags.
williamr@2
    51
         * @param aOrientation The button group's containers orientation. You need specify this 
williamr@2
    52
         *                     only for devices that can layout their buttons either horizontally 
williamr@2
    53
         *                     or vertically. 
williamr@2
    54
         */
williamr@2
    55
        IMPORT_C TCreationData(
williamr@2
    56
            CEikButtonGroupContainer::TUse aUse,
williamr@2
    57
            MEikCommandObserver* aCommandObserver,
williamr@2
    58
            TInt aResourceId, 
williamr@2
    59
            RWindowGroup* aParentWg, 
williamr@2
    60
            TUint aFlags,
williamr@2
    61
            CEikButtonGroupContainer::TOrientation aOrientation);
williamr@2
    62
    public:
williamr@2
    63
        /**
williamr@2
    64
         * Container use type.
williamr@2
    65
         *
williamr@2
    66
         * This member is used to specify to the system the general type of the button group that
williamr@2
    67
         * is required. The system then creates the appropriate button group for the specified type. 
williamr@2
    68
         */
williamr@2
    69
        CEikButtonGroupContainer::TUse iUse;
williamr@2
    70
        
williamr@2
    71
        /**
williamr@2
    72
         * The command observer to be notified of commands on the container. 
williamr@2
    73
         * Not owned.
williamr@2
    74
         */        
williamr@2
    75
        MEikCommandObserver* iCommandObserver;
williamr@2
    76
        
williamr@2
    77
        /**
williamr@2
    78
         * A resource containing descriptions of buttons in the group.
williamr@2
    79
         */
williamr@2
    80
        TInt iResourceId;
williamr@2
    81
        
williamr@2
    82
        /**
williamr@2
    83
         * Parent window group.
williamr@2
    84
         * Not owned.
williamr@2
    85
         */        
williamr@2
    86
        RWindowGroup* iParentWg;
williamr@2
    87
        
williamr@2
    88
        /**
williamr@2
    89
         * Flags for the button group.
williamr@2
    90
         */
williamr@2
    91
        TUint iFlags;
williamr@2
    92
        
williamr@2
    93
        /**
williamr@2
    94
         * Orientation of the new button group.
williamr@2
    95
         */
williamr@2
    96
        CEikButtonGroupContainer::TOrientation iOrientation;
williamr@2
    97
        };
williamr@2
    98
        
williamr@2
    99
public:
williamr@2
   100
    /**
williamr@2
   101
     * Creates a button group of given type if it exists in any registered button group
williamr@2
   102
     * factory function.
williamr@2
   103
     *
williamr@2
   104
     * @param aButtonGroupType The type of button group to be created.
williamr@2
   105
     * @param aCreationData Required extra information.
williamr@2
   106
     * @param aAddToButtonGroupStack Whether to add the button group to the button group stack.
williamr@2
   107
     * @return A handle to the button group interface the constructed object implements. NULL 
williamr@2
   108
     *         if aButtonGroupType doesn't exist in any registered button group factory function.
williamr@2
   109
     */
williamr@2
   110
    static MEikButtonGroup* CreateButtonGroupByTypeL(
williamr@2
   111
        TInt aButtonGroupType,
williamr@2
   112
        TCreationData& aCreationData,
williamr@2
   113
        TBool& aAddToButtonGroupStack);
williamr@2
   114
    };
williamr@2
   115
williamr@2
   116
/**
williamr@2
   117
 * Pointer to a button group factory function is defined as a pointer to a MEikButtonGroup object.
williamr@2
   118
 */
williamr@2
   119
typedef MEikButtonGroup* (*TCreateButtonGroupByTypeFunction)(
williamr@2
   120
    TInt, 
williamr@2
   121
    EikButtonGroupFactory::TCreationData&, 
williamr@2
   122
    TBool&);
williamr@2
   123
williamr@2
   124
/**
williamr@2
   125
 * Array storing the button group factory functions.
williamr@2
   126
 *
williamr@2
   127
 * The CEikButtonGroupFactoryArray class actually stores the button group factory functions
williamr@2
   128
 * which are registered. It also provides facility to add and remove these functions from
williamr@2
   129
 * the storage array. Notably this class is CCoeStatic derived, allowing application wide
williamr@2
   130
 * access.
williamr@2
   131
 *
williamr@2
   132
 * @lib eikcoctl.lib
williamr@2
   133
 * @since S60 0.9 
williamr@2
   134
 */
williamr@2
   135
NONSHARABLE_CLASS(CEikButtonGroupFactoryArray) : public CCoeStatic
williamr@2
   136
    {
williamr@2
   137
public:
williamr@2
   138
    /**
williamr@2
   139
     * Adds a button group factory function to the array.
williamr@2
   140
     *
williamr@2
   141
     * @param aCreateButtonGroupByTypeFunction The factory function to be added.
williamr@2
   142
     */
williamr@2
   143
    IMPORT_C static void AppendFactoryFunctionL(
williamr@2
   144
        TCreateButtonGroupByTypeFunction aCreateButtonGroupByTypeFunction);
williamr@2
   145
        
williamr@2
   146
    /**
williamr@2
   147
     * Removes a button group factory function from the array.
williamr@2
   148
     *
williamr@2
   149
     * @param aCreateButtonGroupByTypeFunction The factory function to be removed.
williamr@2
   150
     */        
williamr@2
   151
    IMPORT_C static void RemoveFactoryFunction(
williamr@2
   152
        TCreateButtonGroupByTypeFunction aCreateButtonGroupByTypeFunction);
williamr@2
   153
williamr@2
   154
    /**
williamr@2
   155
     * Returns the array of pointers to the registered button group factory creation methods.
williamr@2
   156
     *
williamr@2
   157
     * @return The array of button group factory functions.
williamr@2
   158
     */
williamr@2
   159
    static CArrayFixFlat<TCreateButtonGroupByTypeFunction>* ButtonGroupFactoryFuncArray();
williamr@2
   160
williamr@2
   161
    /**
williamr@2
   162
     * Destructor.
williamr@2
   163
     */
williamr@2
   164
    ~CEikButtonGroupFactoryArray();
williamr@2
   165
williamr@2
   166
private:
williamr@2
   167
    inline CEikButtonGroupFactoryArray();
williamr@2
   168
    inline static CEikButtonGroupFactoryArray* Self();
williamr@2
   169
    
williamr@2
   170
private: // data    
williamr@2
   171
    CArrayFixFlat<TCreateButtonGroupByTypeFunction>* iButtonGroupFactoryFuncArray;
williamr@2
   172
    };
williamr@2
   173
williamr@2
   174
#endif // __EIKBGFTY_H__