searchui/searchapp/inc/srchuiresultviewerplugin.h
changeset 0 f979ecb2b13e
equal deleted inserted replaced
-1:000000000000 0:f979ecb2b13e
       
     1 /*
       
     2 * Copyright (c) 2006-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:     Interface class for Srch Ui Result Viewer plugin. All Result Viewer plugins will implement this class.  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 #ifndef C_SRCHUI_RESULT_VIEWER_H
       
    23 #define C_SRCHUI_RESULT_VIEWER_H
       
    24 
       
    25 // System includes
       
    26 #include <aknview.h>
       
    27 #include <aknViewAppUi.h>
       
    28 
       
    29 // User Includes
       
    30 #include "srchuiresulthandler.h"
       
    31 
       
    32 
       
    33 // Constant for plugin interface:
       
    34 //const TUid KSrchUiResultViewerPluginInterfaceUid        = { 0x10207236 };
       
    35 //const TUid KSrchUiResultViewerPluginInterfaceUid        = { 0x10282407 };
       
    36 
       
    37 class CSearchResult;
       
    38 class CSrchUiManager;
       
    39 class CSrchUiResFolder;
       
    40 class MSrchUiFolder;
       
    41 
       
    42 /**
       
    43 * Used by SupportedFormat(). These literals define the desired appearance
       
    44 * of the result in the Result Listbox. 
       
    45 */
       
    46 _LIT(KSrchUiResultViewerSupportsText, "MIME/TEXT");
       
    47 _LIT(KSrchUiResultViewerSupportsPlain, "MIME/PLAIN");
       
    48 _LIT(KSrchUiResultViewerSupportsImage, "MIME/IMAGE");
       
    49 
       
    50 
       
    51 /**
       
    52 * Interface class for Srch Ui Result Viewer plugin. All Result Viewer 
       
    53 * plugins will implement this class.
       
    54 *
       
    55 * Id() function must return the value of the plugin implementation UID. This
       
    56 * means that the main view of the plugin will have the same UID as the plugin
       
    57 * implementation. This will prevent multiple plugins from having same view
       
    58 * UIDs as their main view. If plugin has more views, it is plugin's
       
    59 * responsibility to ensure that the UIDs of the other views are unique. This
       
    60 * can be done for example reserving a unique UID from Symbian.
       
    61 *
       
    62 *
       
    63 */
       
    64 
       
    65 class CSrchUiResultViewerPlugin: public CAknView
       
    66     {
       
    67 
       
    68     
       
    69     public: // Constructors & destructors
       
    70 
       
    71     /**
       
    72     * Ecom interface static factory method implementation.
       
    73     *
       
    74     * @param aImpUid Ecom's implementation uid
       
    75     * @param aManager The Search Ui Manager instance, which is used to talk 
       
    76     * to the Frame work and show the results
       
    77     * @param aAppUi The instance of the Appui.
       
    78     * @return A pointer to the created instance of CSrchUiResultViewerPlugin
       
    79     */
       
    80     static inline CSrchUiResultViewerPlugin* NewL( TUid aImpUid );
       
    81     
       
    82     /**
       
    83     * Ecom interface static factory method implementation.
       
    84     *
       
    85     * @param aImpUid Ecom's implementation uid
       
    86     * @param aManager The Search Ui Manager instance, which is used to talk 
       
    87     *   to the Frame work and show the results
       
    88     * @param aAppUi The instance of the Appui.
       
    89     * @return A pointer to the created instance of CSrchUiResultViewerPlugin
       
    90     */
       
    91     static inline CSrchUiResultViewerPlugin* NewLC( TUid aImpUid );
       
    92     
       
    93     /**
       
    94     * Destructor
       
    95     */
       
    96     virtual ~CSrchUiResultViewerPlugin()
       
    97     {
       
    98       REComSession::DestroyedImplementation( iDtor_ID_Key );
       
    99     // REComSession::Close();
       
   100     }
       
   101     
       
   102 public: // New functions
       
   103 
       
   104     /**
       
   105     * Lists all implementations which satisfy this ecom interface.
       
   106     *
       
   107     * @param aImplInfoArray On return, contains the list of available implementations
       
   108     */
       
   109     static inline void ListAllImplementationsL( RImplInfoPtrArray& aImplInfoArray );
       
   110 
       
   111     /**
       
   112     * Gets the plugin id.
       
   113     *
       
   114     * @since S60 v3.2
       
   115     * @return Id of the plugin.
       
   116     */   
       
   117     inline TUid PluginId() const;
       
   118 
       
   119     /**
       
   120     * Gets the appui.
       
   121     *
       
   122     * @return Appui.
       
   123     */      
       
   124     inline CAknViewAppUi* AppUi();    
       
   125 
       
   126     /**
       
   127     * Gets the supported format.
       
   128     *
       
   129     * @return the supported fromat.
       
   130     */   
       
   131     virtual const TDesC& SupportedFormat() = 0;
       
   132     
       
   133     /**
       
   134     * This function is called to get the opened folder 
       
   135     *
       
   136     * @return the opened folder
       
   137     */ 
       
   138     virtual MSrchUiFolder* OpenFolder() = 0;
       
   139    
       
   140    	/**
       
   141     * This function is called to launch the single result view
       
   142     *
       
   143     @param iSrchUiResRootFolder : The root folder
       
   144     @param aSelectedFolderIdx   : The index of the selected folder
       
   145     @param aSearchFinished      : Indicates if searching is complete/not
       
   146     */
       
   147    	virtual void LaunchViewL(CSrchUiResFolder* iSrchUiResRootFolder,
       
   148    			TInt aSelectedFolderIdx, const TDesC8& aQueryString, TBool aSearchFinished) = 0;
       
   149 	
       
   150 	/**
       
   151     * Updates the Result View with the recently received heavy results
       
   152     @param iSrchUiResRootFolder : The root folder
       
   153     @param aSearchFinished      : Indicates if searching is complete/not
       
   154     */
       
   155 	  virtual void UpdateViewL(CSrchUiResFolder* iSrchUiResRootFolder, TBool aSearchFinished, TBool aResultRetrieve ) = 0;
       
   156 
       
   157 
       
   158 	  /**
       
   159     * This function is called to initialize the observer
       
   160     *
       
   161     @param aResHandler : The observer
       
   162     */
       
   163 	  virtual void CreateManagerObserver(MSrchUiResultHandler* aResHandler) = 0;
       
   164 
       
   165     
       
   166     /**
       
   167     * Returns the extension for this interface. If no extension is available, 
       
   168     * return NULL.
       
   169     *
       
   170     * @param aExtensionUid Uid of the extension.
       
   171     */ 
       
   172     virtual TAny* ViewerPluginExtensionL( TUid /*aExtension*/ ) { return NULL; }
       
   173     
       
   174 
       
   175     
       
   176   private:  // Data
       
   177 
       
   178     TUid iDtor_ID_Key;
       
   179     
       
   180     // Result viewer plugin id
       
   181     TUid iPluginId;
       
   182     
       
   183     // Pointer to application UI
       
   184     CAknViewAppUi* iAppUi;
       
   185     
       
   186     // Pointer to srch ui manager
       
   187     CSrchUiManager* iManager;
       
   188     
       
   189     // Array of pointers to heavy results
       
   190     RPointerArray<CSearchResult> iResults;
       
   191     
       
   192     
       
   193     TInt32 iExtension1;
       
   194     TInt32 iExtension2;  
       
   195     };
       
   196     
       
   197 #include "srchuiresultviewerplugin.inl"
       
   198 
       
   199 #endif // GSPLUGININTERFACE_H
       
   200 //End of file