inputmethods_plat/pen_input_server_api/inc/peninputclient.h
changeset 0 eb1f2e154e89
child 7 6defe5d1bd39
equal deleted inserted replaced
-1:000000000000 0:eb1f2e154e89
       
     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:               This file contains classes of Peninput server client side.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 
       
    30 
       
    31 
       
    32 #ifndef R_RPENINPUTSERVER_H
       
    33 #define R_RPENINPUTSERVER_H
       
    34 
       
    35 //  INCLUDES
       
    36 #include <e32base.h>
       
    37 #include "peninputcmdparam.h"
       
    38 #include <AknFepGlobalEnums.h>
       
    39 
       
    40 class RPeninputServerImpl;
       
    41 class MPeninputServerEventHandler;
       
    42 class MPenUiActivationHandler;
       
    43 
       
    44 /**
       
    45  * Client side interface to PeninputServer.
       
    46  *
       
    47  *
       
    48  * @lib peninputclient.lib
       
    49  * @since S60 v4.0 
       
    50  */
       
    51 const TInt KErrLaunchingServer = -2000;   // indicates server is launching. Connect will be failed at this time
       
    52 NONSHARABLE_CLASS(RPeninputServer)
       
    53     {
       
    54 public:
       
    55     // Constructors and destructor
       
    56 
       
    57     /**
       
    58      * Constructor
       
    59      * 
       
    60      * @since S60 v4.0
       
    61      */
       
    62     IMPORT_C RPeninputServer();
       
    63    
       
    64     /**
       
    65     * Makes a connection to the server.
       
    66     *
       
    67     * @since S60 v4.0
       
    68     * @return KErrNone if connection was successful, otherwise one of the
       
    69     * general error codes.
       
    70     */
       
    71     IMPORT_C TInt Connect();
       
    72 
       
    73     /**
       
    74      * Returns the version information of the server.
       
    75      *
       
    76      * @since S60 v4.0
       
    77      * @return TVersion object containing the version of the server.
       
    78      */
       
    79     IMPORT_C TVersion Version() const;
       
    80 
       
    81 
       
    82     /**
       
    83      * Closes the connection to the server. 
       
    84      *
       
    85      * @since S60 v4.0
       
    86      */
       
    87     IMPORT_C void Close();
       
    88 
       
    89     /**
       
    90      * HandleCommandL, handle command from client
       
    91      *
       
    92      * @since S60 v4.0
       
    93      * @param aCmd The commandid
       
    94      * @param aBuf Command data
       
    95      * @return The command handling result code.KErrNone if operation sucessfully.
       
    96      */    
       
    97     IMPORT_C TInt HandleCommand(TInt aCmd,const TDesC8& aBuf);
       
    98     
       
    99     /**
       
   100      * HandleCommandL, handle command from client
       
   101      *
       
   102      * @since S60 v4.0
       
   103      * @param aCmd The commandid
       
   104      * @return The command handling result code.KErrNone if operation sucessfully.
       
   105      */
       
   106     IMPORT_C TInt HandleCommand(TInt aCmd);
       
   107     /**
       
   108      * HandleCommandL, handle command from client
       
   109      *
       
   110      * @since S60 v4.0
       
   111      * @param aCmd The commandid
       
   112      * @param aBuf Command data
       
   113      * @param aResult The result of layout handle
       
   114      * @return The command handling result code.KErrNone if operation sucessfully.
       
   115      */    
       
   116     IMPORT_C TInt HandleCommand(TInt aCmd,const TDesC8& aBuf,TInt &aResult);
       
   117      
       
   118     /**
       
   119      * Get PENINPUT UI visibility
       
   120      *
       
   121      * @since S60 v4.0
       
   122      * @return ETrue if PENINPUT is visible, EFalse otherwise
       
   123      */
       
   124     IMPORT_C TBool IsVisible();
       
   125 
       
   126     /**
       
   127      * Get PENINPUT UI dim status
       
   128      *
       
   129      * @since S60 v4.0
       
   130      * @return ETrue if PENINPUT is visible, EFalse otherwise
       
   131      */
       
   132     IMPORT_C TBool IsDimmed();
       
   133 	
       
   134     /**
       
   135      * Get supported input mode
       
   136      *
       
   137      * @since S60 v4.0
       
   138      * @return input mode
       
   139      */	
       
   140 	IMPORT_C TInt SupportInputMode();
       
   141 
       
   142 	 /**
       
   143 	 * Set Input Language Id
       
   144 	 *
       
   145 	 * @since S60 v4.0
       
   146 	 * @param aLanguage The input lanuage Id
       
   147 	 * @return The operation result code.KErrNone if successfully.
       
   148 	 */
       
   149 	IMPORT_C TInt SetInputLanguage( TInt aLanguage );
       
   150 
       
   151     /**
       
   152      * Set UI layout id. It will create the UI by the Id
       
   153      *
       
   154      * @since S60 v4.0
       
   155      * @param aId The layout Id
       
   156      * @return The operation result code.KErrNone if successfully.
       
   157      */
       
   158     IMPORT_C TInt SetUiLayoutId(TUid aId);
       
   159     
       
   160     /**
       
   161      * Set UI layout id
       
   162      *
       
   163      * @since S60 v4.0
       
   164      * @param aId The layout Id
       
   165      * @param aData The data associated with the layout creation
       
   166      * @return The operation result code
       
   167      */
       
   168     IMPORT_C TInt SetUiLayoutId(TUid aId,const TDesC8& aData);
       
   169     
       
   170     /**
       
   171      * Set UI layout position
       
   172      *
       
   173      * @since S60 v4.0
       
   174      * @param aPos The layout position
       
   175      * @return The operation result code. KErrNone if successfully.
       
   176      */
       
   177     IMPORT_C TInt SetUiLayoutPos(const TPoint& aPos);        
       
   178 
       
   179     /**
       
   180      * get UI layout position
       
   181      *
       
   182      * @since S60 v4.0
       
   183      * @return The layout position
       
   184      */
       
   185     IMPORT_C TPoint UiLayoutPos();        
       
   186     
       
   187     /**
       
   188      * get UI layout size
       
   189      *
       
   190      * @since S60 v4.0
       
   191      * @return The layout size
       
   192      */    
       
   193     IMPORT_C TSize UiLayoutSize();
       
   194     
       
   195     /**
       
   196      * Called when resource changed, e.g, screen size changed.
       
   197      * To inform layout that resource change event.
       
   198      *
       
   199      * @since S60 v4.0
       
   200      * @param aData The data associated with size change event
       
   201      */
       
   202     IMPORT_C void ResourceChanged(TInt aType);
       
   203     
       
   204     /**
       
   205      * Activate/Deactivate the layout
       
   206      *
       
   207      * @since S60 V4.0
       
   208      * @param aFlag The activation flag. ETrue if activated
       
   209      */
       
   210     IMPORT_C void ActivateLayout(TBool aFlag);        
       
   211 
       
   212     /**
       
   213      * Get server event data.
       
   214      * When server oberver got a event notification, it calls this to get data
       
   215      *
       
   216      * @since S60 V4.0
       
   217      * @param aBuf buf to save the event data on return
       
   218      * @return result code. KErrNone if data got. If the length of aBuf is 
       
   219      *     smaller than server data, data is not copied, return value is the 
       
   220      *     required data length. KNullDesC is returned if no data in server side
       
   221      */
       
   222     IMPORT_C TInt GetServerEventData(TDes& aBuf);
       
   223 
       
   224     /**
       
   225      * Get current pended server event number
       
   226      * 
       
   227      * @since S60 V4.0
       
   228      * @return The current pended event number in server side
       
   229      */
       
   230     IMPORT_C TInt ServerEventDataNum();        
       
   231    
       
   232     /**
       
   233      * Add server observer. An observer will be notified when server has event
       
   234      * 
       
   235      * @since S60 V4.0
       
   236      * @param aObserver The server observer
       
   237      */
       
   238     IMPORT_C void AddPeninputServerObserverL(
       
   239                                    MPeninputServerEventHandler* aObserver);
       
   240 
       
   241 
       
   242     /**
       
   243      * Remove all pen input observer
       
   244      * 
       
   245      * @since S60 V4.0
       
   246      */
       
   247     IMPORT_C void RemovePeninputServerObserver();
       
   248 
       
   249     /**
       
   250      * Remove pen input observer
       
   251      * 
       
   252      * @since S60 V4.0
       
   253      * @param aObserver The server observer to be remvoed
       
   254      */
       
   255     IMPORT_C void RemovePeninputServerObserver(MPeninputServerEventHandler* aObserver);
       
   256     
       
   257     /*
       
   258      * Set display mode. This must be called before any UI layout created.
       
   259      * Otherwise, no change happends.
       
   260      *
       
   261      * @since S60 V4.0
       
   262      * @param aMode The display mode
       
   263      * @param aMaskMode The display mode for mask device
       
   264      */       
       
   265     IMPORT_C void SetDisplayMode(TDisplayMode aDisplayMode,
       
   266                                                TDisplayMode aMaskDisplayMode);
       
   267     /*
       
   268      * Clear server events, all pending events for current session is cleared.
       
   269      * It's used when current focus changed and previous server event is out of date.
       
   270      *
       
   271      * @since S60 V4.0
       
   272      */                  
       
   273     IMPORT_C void ClearServerEvent();
       
   274     
       
   275     /**
       
   276      * Return requried Ime plugin list
       
   277      *
       
   278      * @since S60 V4.0
       
   279      * @param aLanguage The required supporting language
       
   280      * @param aPluginMode The required supporting mode
       
   281      * @param aImplmentationIds A reference to a client owned array
       
   282      *        which will be filled with IME plugin implementation.
       
   283      */
       
   284     IMPORT_C void GetImePluginIdListL(TInt aLanguage, 
       
   285                                       TInt aPluginMode, 
       
   286                                       RArray<TInt>& aImplmentationIds);
       
   287                                      
       
   288     /**
       
   289      * Return all supporing touch input languages
       
   290      *
       
   291      * @since S60 V4.0
       
   292      * @param aLanguageLists A reference to a client owned array
       
   293      *        which will be filled with supporting languages.
       
   294      */
       
   295     IMPORT_C void PenSupportLanguagesL(RArray<TInt>& aLanguageLists);                                     
       
   296     
       
   297     /**
       
   298      * Set foreground application session. Only foreground app session
       
   299      * can change the pen input UI attribute. Such command from other session 
       
   300      * will be discarded by server.
       
   301      *
       
   302      * @since S60 V4.0
       
   303      * @param aMustConnectFlag If ETrue, the set will always success. If EFalse,
       
   304      * operation depends on whether current app is the foreground application.
       
   305      */
       
   306     IMPORT_C TBool SetForeground(TBool aMustConnectFlag);
       
   307 
       
   308     /**
       
   309      * Indicates current client lost foregound.
       
   310      *
       
   311      * @since S60 V5.0
       
   312      */    
       
   313     IMPORT_C void LoseForeground();
       
   314 
       
   315     /**
       
   316      * Test whether this session is the forground application session
       
   317      *
       
   318      * @since S60 V4.0
       
   319      * @return ETrue if current session is foreground application session.
       
   320      */
       
   321     IMPORT_C TBool IsForeground();
       
   322     
       
   323     /**
       
   324      * Add pen input UI activation observer. Only one handler can be added. If 
       
   325      * need to change the handler, the old handler must be first removed.
       
   326      *
       
   327      * @since S60 V4.0
       
   328      * @param aHandler The callback handler when pen input UI activated/deactivated
       
   329      * @param aType The pen ui type to be handled. The available type is defined in 
       
   330      * TPenInputUiType
       
   331      * @return KErrNone if sucessfully.
       
   332      */    
       
   333     IMPORT_C TInt AddPenUiActivationHandler(MPenUiActivationHandler* aHandler,
       
   334                                                 TInt aType);
       
   335     
       
   336     /**
       
   337      * Remove all pen input UI activation observer
       
   338      *
       
   339      * @since S60 V4.0
       
   340      * 
       
   341      */    
       
   342     IMPORT_C void RemovePenUiActivationHandler();    
       
   343 
       
   344     /**
       
   345      * Remove a pen input UI activation observer
       
   346      *
       
   347      * @since S60 V5.0
       
   348      */        
       
   349     IMPORT_C void RemovePenUiActivationHandler(MPenUiActivationHandler *aHandler);
       
   350     
       
   351     
       
   352     IMPORT_C void ActivatePeninputInNotesL(); 
       
   353 
       
   354     /**
       
   355      * Dim the UI layout
       
   356      *
       
   357      * @since S60 V5.0
       
   358      * @param aFlag The dim flag. ETrue if going to dim the ui layout
       
   359      */      
       
   360     IMPORT_C void DimUiLayout(TBool aFlag); 
       
   361    
       
   362     /*
       
   363      * To disable specified layouts at a time.
       
   364      *
       
   365      * @since S60 V4.0
       
   366      * @param aDisableLayout The disabled layouts.Can disable serveral layouts one time.
       
   367      */       
       
   368     IMPORT_C void SetDisabledLayout( TInt aLayouts );
       
   369     
       
   370     /*
       
   371      * To get disable specified layouts at a time.
       
   372      *
       
   373      * @since S60 V4.0
       
   374      * @return The disabled layouts.
       
   375      */       
       
   376     IMPORT_C TInt DisabledLayout();    
       
   377     
       
   378     /*
       
   379      * Update the application information.
       
   380      *
       
   381      * @since S60 V5.0
       
   382      * @param aInfo The application information.
       
   383      * @param aType The information type
       
   384      */     
       
   385     IMPORT_C void UpdateAppInfo(const TDesC& aInfo, TPeninputAppInfo aType);    
       
   386     
       
   387     /*
       
   388      * Enable/disable the auto open feature. When auto open feature is on, Focus change event 
       
   389      * will open the pen UI automatically. The feature is on by default. When disabled, 
       
   390      * all editor in current app won't have the auto-open feature.
       
   391      *
       
   392      * @since S60 V5.0
       
   393      * @param aFlag ETrue to enable the feature, EFalse to disable the feature.
       
   394      */         
       
   395     IMPORT_C void SetAutoOpen(TBool aFlag);
       
   396     
       
   397     /*
       
   398      * Get the auto-open feature flag.
       
   399      *
       
   400      * @since S60 V5.0
       
   401      * @return ETrue if auto-open feature is on, otherwise EFalse.
       
   402      */             
       
   403     IMPORT_C TBool AutoOpen();
       
   404     
       
   405 	IMPORT_C void BackgroudDefaultOri(TInt aOri);
       
   406 	
       
   407     /*
       
   408      * Set the application prefferred input mode. Application can set this mode to 
       
   409      * override the mode selected by Fep. 
       
   410      *
       
   411      * @since S60 V5.0
       
   412      */                 
       
   413     IMPORT_C void SetPreferredUiMode(TPluginInputMode aMode);
       
   414     
       
   415     /*
       
   416      * Get the application prefferred input mode. 
       
   417      *
       
   418      * @since S60 V5.0
       
   419      * @return The application preferred mode. EPluginInputModeNone if app does set it.
       
   420      */                 
       
   421     IMPORT_C  TPluginInputMode PreferredUiMode();
       
   422     
       
   423     IMPORT_C void SetGlobalNotes(TBool aFlag);
       
   424     IMPORT_C void SetInternalPopUp(TBool aFlag);
       
   425     IMPORT_C void SetEditorPriority(TInt aFlag); 
       
   426     IMPORT_C void ClearTouchUI();
       
   427     IMPORT_C void SetResourceChange(TBool aFlag); 
       
   428     IMPORT_C TInt ConnectAsyc(TRequestStatus& aStatus);
       
   429 
       
   430 private:    // Data
       
   431     /**
       
   432      * The singleton client to the input server
       
   433      */    		    
       
   434     RPeninputServerImpl* iSingletonServer;
       
   435 };
       
   436 //end of class RPeninputServer 
       
   437 #endif //R_RPENINPUTSERVER_H
       
   438 
       
   439 // End of File