homescreensrv_plat/ai_utilities_api/inc/aiutility.h
changeset 0 79c6a41cd166
equal deleted inserted replaced
-1:000000000000 0:79c6a41cd166
       
     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:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef AIUTILITY_H
       
    20 #define AIUTILITY_H
       
    21 
       
    22 #include <e32std.h>
       
    23 #include <aicontentmodel.h>
       
    24 
       
    25 class MAiPSPropertyObserver;
       
    26 class MAiStrParser;
       
    27 class MAiContentItemIterator;
       
    28 class MAiPluginSettings;
       
    29 class MAiPluginTool;
       
    30 
       
    31 /**
       
    32 *  Active Idle Utility Library.
       
    33 *
       
    34 *  @since S60 3.2
       
    35 */
       
    36 namespace AiUtility
       
    37     {
       
    38     
       
    39 	/**
       
    40      * Creates a Publish & Subscribe keys observer.
       
    41      *
       
    42      * @param aCallBack callback method to call when the key value changes.
       
    43      * @param aCategory key category.
       
    44      * @param aKey key to observe in category.
       
    45      * @return pointer to a new publish and subscribe keys observer.
       
    46      */
       
    47 	IMPORT_C MAiPSPropertyObserver* CreatePSPropertyObserverL(
       
    48 	                                            TCallBack aCallBack,
       
    49 	                                            TUid aCategory,
       
    50 	                                            TInt aKey );    
       
    51       
       
    52     /**
       
    53     * Creates a string parser.
       
    54     *
       
    55     * @return pointer to a new string parser.
       
    56     */
       
    57     IMPORT_C MAiStrParser* CreateStrParserL();
       
    58             
       
    59     /**
       
    60  	* Creates a new iterator instance from a TAiContentItem array.
       
    61  	*
       
    62  	* @since S60 3.2
       
    63  	* @param aArray content item array.
       
    64  	* @param aCount  number of content items in aArray.
       
    65  	* @return a new iterator object for aArray.
       
    66  	*/
       
    67     IMPORT_C MAiContentItemIterator* CreateContentItemArrayIteratorL(
       
    68                                                 const TAiContentItem* aArray,
       
    69                                                 TInt aCount );
       
    70 
       
    71     /**
       
    72      * Helper factory function for creating a MAiContentItemIterator out
       
    73      * of a const C array of TAiContentItem objects. This function infers the item
       
    74      * count of the array automatically from the array argument passed to it.
       
    75      * 
       
    76      * @param aArray const C array of TAiContentItem objects.
       
    77      * @return MAiContentItemIterator instance for iterating aArray. Client
       
    78      *         takes ownership of the returned object.
       
    79      */
       
    80     template<int N> 
       
    81     inline MAiContentItemIterator* CreateContentItemArrayIteratorL
       
    82             ( const TAiContentItem (&aArray)[N] )
       
    83         {
       
    84         return AiUtility::CreateContentItemArrayIteratorL(aArray, N);
       
    85         }
       
    86     
       
    87     /**
       
    88      * Creates the plugin settings.
       
    89      *
       
    90      * @since S60 3.2
       
    91      * @return pointer to plugin settings.
       
    92      */
       
    93     IMPORT_C MAiPluginSettings* CreatePluginSettingsL();
       
    94 
       
    95     /**
       
    96      * Creates the plugin tool.
       
    97      *
       
    98      * @since S60 3.2
       
    99      * @return pointer to plugin tool.
       
   100      */
       
   101     IMPORT_C MAiPluginTool* CreatePluginToolL();
       
   102 
       
   103     }
       
   104 
       
   105 #endif      // AIUTILITY_H
       
   106