remotemgmt_plat/adaptive_history_list_api/inc/ahlededicatedapi.h
branchRCL_3
changeset 76 3cdbd92ee07b
parent 69 a082c848c9a9
equal deleted inserted replaced
69:a082c848c9a9 76:3cdbd92ee07b
     1 /*
       
     2 * Copyright (c) 2002-2005 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:  API definition for dedicated clients.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef MAHLEDEDICATEDAPI_H
       
    19 #define MAHLEDEDICATEDAPI_H
       
    20 
       
    21 #include <badesca.h>
       
    22 #include <ahlededicated.h>
       
    23 
       
    24 class MAHLEObserver;
       
    25 
       
    26 /**
       
    27 *  AHLE API for dedicated clients.
       
    28 *  Provides API interface for dedicated clients
       
    29 *
       
    30 *  @lib AHLE2CLIENT.lib
       
    31 *  @since Series 60 3.1
       
    32 */
       
    33 class MAHLEDedicatedAPI
       
    34     {
       
    35     public:
       
    36 
       
    37         /**
       
    38         * Destructor.
       
    39         */
       
    40         inline virtual ~MAHLEDedicatedAPI();
       
    41 
       
    42         /**
       
    43         * Check if the client has been connected to the server
       
    44         *
       
    45         * @return ETrue if connected, otherwise EFalse
       
    46         */
       
    47         virtual TBool IsConnected() = 0;
       
    48 
       
    49         /**
       
    50         * Set client observer
       
    51         *
       
    52         * @param aObserver client observer
       
    53         */
       
    54         virtual void SetObserverL(const MAHLEObserver* aObserver) = 0;
       
    55 
       
    56         /**
       
    57         * Cancel client observer
       
    58         */
       
    59         virtual void CancelObserver() = 0;
       
    60 
       
    61         /**
       
    62         * Engine reconfiguration.
       
    63         * New storage sizes have to be explicitly specified.
       
    64         *
       
    65         * @param aPrimarySize New primary storage size.
       
    66         * @param aSecondarySize New secondary storage size.
       
    67         * @param aAdaptationSpeed New adaptation speed.
       
    68         * @returns KErrNone if ok, otherwise an error code. Returns KErrInUse
       
    69         *          if AHLE server is busy (e.g. reading or writing file) and
       
    70         *          KErrArgument if one of parameters is out of range.
       
    71         */
       
    72         virtual TInt Reconfigure(
       
    73                 TUint aPrimarySize,
       
    74                 TUint aSecondarySize,
       
    75                 TReal32 aAdaptationSpeed) = 0;
       
    76 
       
    77         /**
       
    78         * Current engine configuration.
       
    79         *
       
    80         * @param aPrimarySize Current primary storage size.
       
    81         * @param aSecondarySize Current secondary storage size.
       
    82         * @param aAdaptationSpeed Current adaptation speed.
       
    83         */
       
    84         virtual TInt GetConfiguration(
       
    85                 TUint& aPrimarySize,
       
    86                 TUint& aSecondarySize,
       
    87                 TReal32& aAdaptationSpeed) = 0;
       
    88 
       
    89         /**
       
    90         * Logging new access synchronously.
       
    91         * Used by Browser, Emails, Logs, Messaging, Phonebook
       
    92         *
       
    93         * @param aItem Access descriptor, key value in adaptive list
       
    94         *              Browser - url. URLs should follow URI Generic Syntax
       
    95         *                          described in RFC 2396
       
    96         *              Emails - email address
       
    97         *              Logs - telephone number
       
    98         *              Messaging - linkID
       
    99         *              Phonebook - linkID
       
   100         * @param aDescription specific information about aItem
       
   101         *              Browser - name (e.g. Content of WML/HTML title tag)
       
   102         *                  (defaults to empty string)
       
   103         *              Emails - defaults to empty string
       
   104         *              Logs - defaults to empty string
       
   105         *              Messaging - telephone number or e-mail address
       
   106         *                          (second part of key value)
       
   107         *              Phonebook - telephone number (second part of key value)
       
   108         * @returns KErrNone if ok, otherwise an error code. Returns KErrInUse
       
   109         *          if AHLE server is in use (e.g. reading or writing file) and
       
   110         *          KErrArgument if size of one of parameters is out of range.
       
   111         */
       
   112         virtual TInt NewAccess(
       
   113                 const TDesC& aItem,
       
   114                 const TDesC& aDescription = KAHLEItemDefaultDescription) = 0;
       
   115 
       
   116         /**
       
   117         * Logging new access asynchronously.
       
   118         * Used by Browser, Emails, Logs, Messaging, Phonebook
       
   119         *
       
   120         * @param aStatus Asychronous request status.
       
   121         * @param aItem Access descriptor, key value in adaptive list
       
   122         *              Browser - url. URLs should follow URI Generic Syntax
       
   123         *                          described in RFC 2396
       
   124         *              Emails - email address
       
   125         *              Logs - telephone number
       
   126         *              Messaging - linkID
       
   127         *              Phonebook - linkID
       
   128         * @param aDescription Name or telephone number
       
   129         *              Browser - name (e.g. Content of WML/HTML title tag)
       
   130         *                        (defaults to empty string)
       
   131         *              Emails - defaults to empty string
       
   132         *              Logs - defaults to empty string
       
   133         *              Messaging - telephone number or e-mail address
       
   134         *                          (second part of key value)
       
   135         *              Phonebook - telephone number (second key value)
       
   136         */
       
   137         virtual void NewAccessL(
       
   138                 TRequestStatus& aStatus,
       
   139                 const TDesC& aItem,
       
   140                 const TDesC& aDescription = KAHLEItemDefaultDescription) = 0;
       
   141 
       
   142         /**
       
   143         * Get adaptive list synchronously. Used by Emails and Logs.
       
   144         *
       
   145         * @param aItems Descriptor array containing items in ranked order.
       
   146         *              Emails - email addresses
       
   147         *              Logs - telephone numbers
       
   148         * @param aSize Maximum length of returned list
       
   149         * @returns KErrNone if ok, otherwise an error code. Returns KErrInUse
       
   150         *          if AHLE server is busy (e.g. reading or writing file).
       
   151         */
       
   152         virtual TInt AdaptiveListL(
       
   153                 CDesCArray&  aItems,
       
   154                 const TUint  aSize) = 0;
       
   155 
       
   156         /**
       
   157         * Get adaptive list asynchronously. Used by Emails and Logs.
       
   158         *
       
   159         * @param aStatus Asynchronous request status.
       
   160         * @param aItems Descriptor array containing items in ranked order.
       
   161         *              Emails - email addresses
       
   162         *              Logs - telephone numbers
       
   163         * @param aSize Maximum length of returned list
       
   164         */
       
   165         virtual void AdaptiveListL(
       
   166                 TRequestStatus& aStatus,
       
   167                 CDesCArray& aItems,
       
   168                 const TUint aSize) = 0;
       
   169 
       
   170         /**
       
   171         * Get adaptive list synchronously.
       
   172         * Used by Browser, Messaging and Phonebook.
       
   173         * For Browser there is an option of selecting sites/groups or details
       
   174         * (e.g. All the urls within a site or members of a group) for a
       
   175         * site/group. In case of auto-complete, parameter
       
   176         * EAHLEAdaptiveAutoComplete as aState should be used.
       
   177         *
       
   178         * @param aItems Descriptor array containing key items in ranked order
       
   179         *              Browser - array of URLs
       
   180         *              Messaging - array of linkIDs
       
   181         *              Phonebook - array of linkIDs
       
   182         * @param aDescription Descriptor array containing names or telephone
       
   183         *        numbers in ranked order
       
   184         *              Browser - array of URL names
       
   185         *              Messaging - array of telephone numbers or
       
   186         *                          e-mail addresses (indirectly thrue phonebook)
       
   187         *              Phonebook - array of telephone numbers
       
   188         * @param aSize Maximum length of returned list
       
   189         * @param aMatch
       
   190         *              Browser - Substring to match beginnings of adaptive list
       
   191         *                        items. Matching is case insensitive.
       
   192         *              Messaging - default value
       
   193         *              Phonebook - default value
       
   194         * @param aState
       
   195         *              Browser - Details of adaptive list items - possible
       
   196         *                         values:
       
   197         *                  EAHLEAdaptiveSiteList,
       
   198         *                  EAHLEAdaptiveSiteDetails and
       
   199         *                  EAHLEAdaptiveAutoComplete.
       
   200         *              Messaging - default value
       
   201         *              Phonebook - default value
       
   202         * @returns KErrNone if ok, otherwise an error code. Returns KErrInUse
       
   203         *          if AHLE server is busy (e.g. reading or writing file) and
       
   204         *          KErrArgument if size of one of parameters is incorrect.
       
   205         */
       
   206         virtual TInt AdaptiveListL(
       
   207                 CDesCArray&  aItems,
       
   208                 CDesCArray& aDescription,
       
   209                 const TUint aSize,
       
   210                 const TDesC& aMatch = KAHLENoMatch,
       
   211                 const TAHLEState aState = EAHLEAdaptiveSiteList) = 0;
       
   212 
       
   213         /**
       
   214         * Get adaptive list asynchronously.
       
   215         * Used by Browser, Messaging and Phonebook.
       
   216         * For Browser there is an option of selecting sites/groups or details
       
   217         * (e.g. All the urls within a site or members of a group) for a
       
   218         * site/group. In case of auto-complete, parameter
       
   219         * EAHLEAdaptiveAutoComplete as aState should be used.
       
   220         *
       
   221         * @param aStatus Asynchronous request status.
       
   222         * @param aItems Descriptor array containing key items in ranked order
       
   223         *              Browser - array of URLs
       
   224         *              Messaging - array of linkIDs
       
   225         *              Phonebook - array of linkIDs
       
   226         * @param aDescription Descriptor array containing names or telephone
       
   227         *        numbers in ranked order
       
   228         *              Browser - array of URL names
       
   229         *              Messaging - array of telephone numbers or
       
   230         *                          e-mail addresses (indirectly thrue phonebook)
       
   231         *              Phonebook - array of telephone numbers
       
   232         * @param aSize Maximum length of returned list
       
   233         * @param aMatch
       
   234         *              Browser - Substring to match beginnings of adaptive list
       
   235         *                        items. Matching is case insensitive.
       
   236         *              Messaging - default value
       
   237         *              Phonebook - default value
       
   238         * @param aState
       
   239         *              Browser - Details of adaptive list items - possible
       
   240         *                         values:
       
   241         *                  EAHLEAdaptiveSiteList,
       
   242         *                  EAHLEAdaptiveSiteDetails and
       
   243         *                  EAHLEAdaptiveAutoComplete.
       
   244         *              Messaging - default value
       
   245         *              Phonebook - default value
       
   246         */
       
   247         virtual void AdaptiveListL(
       
   248                 TRequestStatus& aStatus,
       
   249                 CDesCArray&  aItems,
       
   250                 CDesCArray&  aDescription,
       
   251                 const TUint  aSize,
       
   252                 const TDesC& aMatch = KAHLENoMatch,
       
   253                 const TAHLEState aState = EAHLEAdaptiveSiteList) = 0;
       
   254 
       
   255         /**
       
   256         * Remove item synchronously.
       
   257         * Used by Browser, Emails, Logs, Messaging, Phonebook
       
   258         *
       
   259         * @param aItem Item to be removed
       
   260         *              Browser - a url
       
   261         *              Emails - an email
       
   262         *              Logs - a telephone number
       
   263         *              Messaging - linkID
       
   264         *              Phonebook - linkID
       
   265         * @param aPhoneNumber telephone number to be removed from a contact
       
   266         *              Browser - defaults to empty string
       
   267         *              Emails - defaults to empty string
       
   268         *              Logs - defaults to empty string
       
   269         *              Messaging - telephone number or e-mail address
       
   270         *              Phonebook - telephone number
       
   271         * @returns KErrNone if ok, otherwise an error code. Returns KErrInUse
       
   272         *          if AHLE server is busy (e.g. reading or writing file) and
       
   273         *          KErrArgument if size of one of parameters is to long.
       
   274         */
       
   275         virtual TInt Remove(
       
   276                 const TDesC& aItem,
       
   277                 const TDesC& aPhoneNumber = KAHLEItemDefaultDescription) = 0;
       
   278 
       
   279         /**
       
   280         * Remove item asynchronously.
       
   281         * Used by Browser, Emails, Logs, Messaging, Phonebook
       
   282         *
       
   283         * @param aStatus Request status (in asynchronous versions)
       
   284         * @param aItem Item to be removed
       
   285         *              Browser - a url
       
   286         *              Emails - an email
       
   287         *              Logs - a telephone number
       
   288         *              Messaging - linkID
       
   289         *              Phonebook - linkID
       
   290         * @param aPhoneNumber telephone number to be removed from a contact
       
   291         *              Browser - defaults to empty string
       
   292         *              Emails - defaults to empty string
       
   293         *              Logs - defaults to empty string
       
   294         *              Messaging - telephone number or e-mail address
       
   295         *              Phonebook - telephone number
       
   296         */
       
   297         virtual void RemoveL(
       
   298                 TRequestStatus& aStatus,
       
   299                 const TDesC& aItem,
       
   300                 const TDesC& aPhoneNumber = KAHLEItemDefaultDescription) = 0;
       
   301 
       
   302         /**
       
   303         * Remove items synchronously.
       
   304         * Used by Browser, Emails, Logs
       
   305         *
       
   306         * @param aItems Items to be removed
       
   307         *              Browser - array of urls
       
   308         *              Emails - array of emails
       
   309         *              Logs - array of telephone numbers
       
   310         * @returns KErrNone if ok, otherwise an error code. Returns KErrInUse
       
   311         *          if AHLE server is busy (e.g. reading or writing file) and
       
   312         *          KErrArgument if table is empty or one of items in table is
       
   313         *          empty.
       
   314         */
       
   315         virtual TInt RemoveL(const CDesCArray& aItems) = 0;
       
   316 
       
   317         /**
       
   318         * Remove items asynchronously.
       
   319         * Used by Browser, Emails, Logs
       
   320         *
       
   321         * @param aStatus Request status
       
   322         * @param aItems Items to be removed
       
   323         *              Browser - array of urls
       
   324         *              Emails - array of emails
       
   325         *              Logs - array of telephone numbers
       
   326         */
       
   327         virtual void RemoveL(
       
   328                 TRequestStatus& aStatus,
       
   329                 const CDesCArray& aItems) = 0;
       
   330 
       
   331 
       
   332         /**
       
   333         * Remove items synchronously.
       
   334         * Used by Messaging, Phonebook
       
   335         *
       
   336         * @param aItems Array of linkIDs to be removed
       
   337         * @param aPhoneNumbers Array of telephone numbers or/and
       
   338         *                      e-mail addresses to be removed
       
   339         *        from a contact.
       
   340         * @returns KErrNone if ok, otherwise an error code. Returns KErrInUse
       
   341         *          if AHLE server is busy (e.g. reading or writing file)  and
       
   342         *          KErrArgument if table is empty or one of items in table is
       
   343         *          empty.
       
   344         */
       
   345         virtual TInt RemoveL(
       
   346                 const CDesCArray& aItems,
       
   347                 const CDesCArray& aPhoneNumbers) = 0;
       
   348 
       
   349         /**
       
   350         * Remove items asynchronously.
       
   351         * Used by Messaging, Phonebook
       
   352         *
       
   353         * @param aStatus Request status
       
   354         * @param aItems Array of linkIDs to be removed
       
   355         * @param aPhoneNumbers Array of telephone numbers or/and
       
   356         *                      e-mail addresses to be removed
       
   357         */
       
   358         virtual void RemoveL(
       
   359                 TRequestStatus& aStatus,
       
   360                 const CDesCArray& aItems,
       
   361                 const CDesCArray& aPhoneNumbers) = 0;
       
   362 
       
   363         /**
       
   364         * Remove matching items synchronously.
       
   365         * Used by Browser, Messaging, Phonebook
       
   366         *
       
   367         * @param aMatch Match for items to be removed.
       
   368         *              Browser - matching string. Removes all items that match
       
   369         *                  the given string. Matching is case sensitive.
       
   370         *              Messaging - linkID. Removes all items corresponding to
       
   371         *                  the linkID
       
   372         *              Phonebook - linkID. Removes all items corresponding to
       
   373         *                  the linkID
       
   374         * @returns The number of removed items, or otherwise an error code.
       
   375         *          Returns KErrInUse if AHLE server is busy (e.g. reading or
       
   376         *          writing file) and KErrArgument if match is to long.
       
   377         */
       
   378         virtual TInt RemoveMatching(const TDesC& aMatch) = 0;
       
   379 
       
   380         /**
       
   381         * Remove matching items asynchronously.
       
   382         * Used by Browser, Messaging, Phonebook
       
   383         *
       
   384         * @param aStatus Request status
       
   385         * @param aMatch Match for items to be removed.
       
   386         *              Browser - matching string. Removes all items that match
       
   387         *                  the given string. Matching is case sensitive.
       
   388         *              Messaging - linkID. Removes all items corresponding to
       
   389         *                  the linkID
       
   390         *              Phonebook - linkID. Removes all items corresponding to
       
   391         *                  the linkID
       
   392         */
       
   393         virtual void RemoveMatchingL(
       
   394                 TRequestStatus& aStatus,
       
   395                 const TDesC& aMatch) = 0;
       
   396 
       
   397         /**
       
   398         * Rename item synchronously
       
   399         * Used by Browser, Messaging, Phonebook
       
   400         *
       
   401         * @param aItem Item to be renamed
       
   402         *              Browser - a url
       
   403         *              Messaging - linkID
       
   404         *              Phonebook - linkID
       
   405         * @param aNewDescription New description.
       
   406         *              Browser - new name of url
       
   407         *              Messaging - new telephone number or e-mail address
       
   408         *              Phonebook - new telephone number
       
   409         * @param aDescription  Description to be renamed.
       
   410         *              Browser - defaults to empty string
       
   411         *              Messaging - old telephone number or e-mail address
       
   412         *              Phonebook - old telephone number
       
   413         * @returns KErrNone if ok, otherwise an error code. Returns KErrInUse
       
   414         *          if AHLE server is busy (e.g. reading or writing file) and
       
   415         *          KErrArgument if size of one of parameters is to long.
       
   416         */
       
   417         virtual TInt RenameL(
       
   418                 const TDesC& aItem,
       
   419                 const TDesC& aNewDescription,
       
   420                 const TDesC& aDescription = KAHLEItemDefaultDescription) = 0;
       
   421 
       
   422         /**
       
   423         * Rename item asynchronously
       
   424         * Used by Browser, Messaging, Phonebook
       
   425         *
       
   426         * @param aStatus Request status
       
   427         * @param aItem Item to be renamed
       
   428         *              Browser - a url
       
   429         *              Messaging - linkID
       
   430         *              Phonebook - linkID
       
   431         * @param aNewDescription New description.
       
   432         *              Browser - new name of url
       
   433         *              Messaging - new telephone number or e-mail address
       
   434         *              Phonebook - new telephone number
       
   435         * @param aDescription  Description to be renamed.
       
   436         *              Browser - defaults to empty string
       
   437         *              Messaging - old telephone number or e-mail address
       
   438         *              Phonebook - old telephone number
       
   439         */
       
   440         virtual void RenameL(
       
   441                 TRequestStatus& aStatus,
       
   442                 const TDesC& aItem,
       
   443                 const TDesC& aNewDescription,
       
   444                 const TDesC& aDescription = KAHLEItemDefaultDescription) = 0;
       
   445 
       
   446         /**
       
   447         * Clear all adaptive list items synchronously
       
   448         *
       
   449         * @returns KErrNone if ok, otherwise an error code.
       
   450         *          Returns KErrInUse if AHLE server is busy
       
   451         *          (e.g. reading or writing file).
       
   452         */
       
   453         virtual TInt Clear() = 0;
       
   454 
       
   455         /**
       
   456         * Clear all adaptive list items asynchronously
       
   457         *
       
   458         * @param aStatus Request status
       
   459         */
       
   460         virtual void Clear(TRequestStatus& aStatus) = 0;
       
   461 
       
   462         /**
       
   463         * Flush cached items to persistent storage synchronously
       
   464         *
       
   465         * @returns KErrNone if ok, otherwise an error code.
       
   466         *          Returns KErrInUse if AHLE server is busy
       
   467         *          (e.g. reading or writing file).
       
   468         */
       
   469         virtual TInt Flush() = 0;
       
   470 
       
   471         /**
       
   472         * Flush cached items to persistent storage asynchronously
       
   473         *
       
   474         * @param aStatus Request status
       
   475         * @returns KErrNone if ok, otherwise an error code.
       
   476         *          Returns KErrInUse if AHLE server is busy
       
   477         *          (e.g. reading or writing file).
       
   478         */
       
   479         virtual void Flush(TRequestStatus& aStatus) = 0;
       
   480     };
       
   481 
       
   482 #include "ahlededicatedapi.inl"
       
   483 
       
   484 /**
       
   485 * AHLE Client API constructor
       
   486 * @param aClientType AHLE client type
       
   487 * @return MAHLEDedicatedAPI pointer to AHLE Client API
       
   488 */
       
   489 IMPORT_C MAHLEDedicatedAPI* NewAHLEClientL(TAHLEClientType aClientType);
       
   490 
       
   491 #endif      // MAHLEDEDICATEDAPI_H
       
   492 
       
   493 // End of File