1.1 --- a/epoc32/include/mw/eikbgfty.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/mw/eikbgfty.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,174 @@
1.4 -eikbgfty.h
1.5 +/*
1.6 +* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
1.7 +* All rights reserved.
1.8 +* This component and the accompanying materials are made available
1.9 +* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.10 +* which accompanies this distribution, and is available
1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.12 +*
1.13 +* Initial Contributors:
1.14 +* Nokia Corporation - initial contribution.
1.15 +*
1.16 +* Contributors:
1.17 +*
1.18 +* Description: Button group factory interface definitions.
1.19 +*
1.20 +*/
1.21 +
1.22 +
1.23 +#ifndef __EIKBGFTY_H__
1.24 +#define __EIKBGFTY_H__
1.25 +
1.26 +#include <eikbtgpc.h>
1.27 +#include <coemain.h>
1.28 +
1.29 +/**
1.30 + * The EikButtonGroupFactory class provides an interface to the button group factory.
1.31 + *
1.32 + * @lib eikcoctl.lib
1.33 + * @since S60 0.9
1.34 + */
1.35 +class EikButtonGroupFactory
1.36 + {
1.37 +public:
1.38 + /**
1.39 + * Defines information required to create a button group.
1.40 + *
1.41 + * @lib eikcoctl.lib
1.42 + */
1.43 + class TCreationData
1.44 + {
1.45 + public:
1.46 + /**
1.47 + * Constructor taking arguments required to create a button group.
1.48 + *
1.49 + * @param aUse The type of button group container.
1.50 + * @param aCommandObserver A command observer to be notified of commands on the container.
1.51 + * @param aResourceId A resource containing descriptions of buttons in the group.
1.52 + * This can be NULL if buttons are to be added dynamically.
1.53 + * @param aParentWg Parent window group.
1.54 + * @param aFlags The button group's flags.
1.55 + * @param aOrientation The button group's containers orientation. You need specify this
1.56 + * only for devices that can layout their buttons either horizontally
1.57 + * or vertically.
1.58 + */
1.59 + IMPORT_C TCreationData(
1.60 + CEikButtonGroupContainer::TUse aUse,
1.61 + MEikCommandObserver* aCommandObserver,
1.62 + TInt aResourceId,
1.63 + RWindowGroup* aParentWg,
1.64 + TUint aFlags,
1.65 + CEikButtonGroupContainer::TOrientation aOrientation);
1.66 + public:
1.67 + /**
1.68 + * Container use type.
1.69 + *
1.70 + * This member is used to specify to the system the general type of the button group that
1.71 + * is required. The system then creates the appropriate button group for the specified type.
1.72 + */
1.73 + CEikButtonGroupContainer::TUse iUse;
1.74 +
1.75 + /**
1.76 + * The command observer to be notified of commands on the container.
1.77 + * Not owned.
1.78 + */
1.79 + MEikCommandObserver* iCommandObserver;
1.80 +
1.81 + /**
1.82 + * A resource containing descriptions of buttons in the group.
1.83 + */
1.84 + TInt iResourceId;
1.85 +
1.86 + /**
1.87 + * Parent window group.
1.88 + * Not owned.
1.89 + */
1.90 + RWindowGroup* iParentWg;
1.91 +
1.92 + /**
1.93 + * Flags for the button group.
1.94 + */
1.95 + TUint iFlags;
1.96 +
1.97 + /**
1.98 + * Orientation of the new button group.
1.99 + */
1.100 + CEikButtonGroupContainer::TOrientation iOrientation;
1.101 + };
1.102 +
1.103 +public:
1.104 + /**
1.105 + * Creates a button group of given type if it exists in any registered button group
1.106 + * factory function.
1.107 + *
1.108 + * @param aButtonGroupType The type of button group to be created.
1.109 + * @param aCreationData Required extra information.
1.110 + * @param aAddToButtonGroupStack Whether to add the button group to the button group stack.
1.111 + * @return A handle to the button group interface the constructed object implements. NULL
1.112 + * if aButtonGroupType doesn't exist in any registered button group factory function.
1.113 + */
1.114 + static MEikButtonGroup* CreateButtonGroupByTypeL(
1.115 + TInt aButtonGroupType,
1.116 + TCreationData& aCreationData,
1.117 + TBool& aAddToButtonGroupStack);
1.118 + };
1.119 +
1.120 +/**
1.121 + * Pointer to a button group factory function is defined as a pointer to a MEikButtonGroup object.
1.122 + */
1.123 +typedef MEikButtonGroup* (*TCreateButtonGroupByTypeFunction)(
1.124 + TInt,
1.125 + EikButtonGroupFactory::TCreationData&,
1.126 + TBool&);
1.127 +
1.128 +/**
1.129 + * Array storing the button group factory functions.
1.130 + *
1.131 + * The CEikButtonGroupFactoryArray class actually stores the button group factory functions
1.132 + * which are registered. It also provides facility to add and remove these functions from
1.133 + * the storage array. Notably this class is CCoeStatic derived, allowing application wide
1.134 + * access.
1.135 + *
1.136 + * @lib eikcoctl.lib
1.137 + * @since S60 0.9
1.138 + */
1.139 +NONSHARABLE_CLASS(CEikButtonGroupFactoryArray) : public CCoeStatic
1.140 + {
1.141 +public:
1.142 + /**
1.143 + * Adds a button group factory function to the array.
1.144 + *
1.145 + * @param aCreateButtonGroupByTypeFunction The factory function to be added.
1.146 + */
1.147 + IMPORT_C static void AppendFactoryFunctionL(
1.148 + TCreateButtonGroupByTypeFunction aCreateButtonGroupByTypeFunction);
1.149 +
1.150 + /**
1.151 + * Removes a button group factory function from the array.
1.152 + *
1.153 + * @param aCreateButtonGroupByTypeFunction The factory function to be removed.
1.154 + */
1.155 + IMPORT_C static void RemoveFactoryFunction(
1.156 + TCreateButtonGroupByTypeFunction aCreateButtonGroupByTypeFunction);
1.157 +
1.158 + /**
1.159 + * Returns the array of pointers to the registered button group factory creation methods.
1.160 + *
1.161 + * @return The array of button group factory functions.
1.162 + */
1.163 + static CArrayFixFlat<TCreateButtonGroupByTypeFunction>* ButtonGroupFactoryFuncArray();
1.164 +
1.165 + /**
1.166 + * Destructor.
1.167 + */
1.168 + ~CEikButtonGroupFactoryArray();
1.169 +
1.170 +private:
1.171 + inline CEikButtonGroupFactoryArray();
1.172 + inline static CEikButtonGroupFactoryArray* Self();
1.173 +
1.174 +private: // data
1.175 + CArrayFixFlat<TCreateButtonGroupByTypeFunction>* iButtonGroupFactoryFuncArray;
1.176 + };
1.177 +
1.178 +#endif // __EIKBGFTY_H__