searchsrv_plat/cpix_search_api/inc/cpixdocumentfield.h
changeset 15 cf5c74390b98
child 24 65456528cac2
equal deleted inserted replaced
10:afe194b6b1cd 15:cf5c74390b98
       
     1 /*
       
     2 * Copyright (c) 2010 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:  Qt search document field APIs
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef _CPIXDOCUMENTFIELD_H
       
    19 #define _CPIXDOCUMENTFIELD_H
       
    20 
       
    21 #ifdef BUILD_DLL
       
    22 #define DLL_EXPORT Q_DECL_EXPORT
       
    23 #else
       
    24 #define DLL_EXPORT Q_DECL_IMPORT
       
    25 #endif
       
    26 
       
    27 /**
       
    28  * @file
       
    29  * @ingroup Qt Search ClientAPI
       
    30  * @brief Contains CCPixDocument field APIs
       
    31  */
       
    32 
       
    33 #include <QObject>
       
    34 
       
    35 //Forward decelaration
       
    36 class CpixDocumentFieldPrivate;
       
    37 
       
    38 /**
       
    39  * @brief Represents the fields of documents returned as a result of a search query.
       
    40  * @ingroup ClientAPI
       
    41  * 
       
    42  * Link against: cpixsearch.lib 
       
    43  */
       
    44 class DLL_EXPORT CpixDocumentField: public QObject
       
    45     {
       
    46     Q_OBJECT
       
    47 public:
       
    48     /**
       
    49      * Constructor.
       
    50      * Creates a CpixDocumentField object and return a pointer to the created object.
       
    51      * @param aName Name of the field
       
    52      * @param aValue Value of the field
       
    53      * @param aConfig Config for the field
       
    54      * @return A pointer to the created instance of CpixDocumentField.
       
    55      * 
       
    56      * @note After using this constructor, the client has to mandatorily call 
       
    57      * SetDatabase() before invoking any search.
       
    58      */
       
    59     static CpixDocumentField* newInstance( const QString aName, const QString aValue, const int aConfig );
       
    60 
       
    61     /**
       
    62      * Destructor.
       
    63      */
       
    64     virtual ~CpixDocumentField();
       
    65 
       
    66     /**
       
    67      * Getter: Gets the name of the field.
       
    68      * @return The name of the field
       
    69      */
       
    70     QString name() const;
       
    71 
       
    72     /**
       
    73      * Getter: Gets the Value of the field.
       
    74      * @return The value of the field
       
    75      */
       
    76     QString value() const;
       
    77 
       
    78     /**
       
    79      * Getter: Gets the Config of the field.
       
    80      * @return The config of the field
       
    81      */
       
    82     int config() const;
       
    83 
       
    84     /**
       
    85      * Setter: Sets the Name of the field.
       
    86      * @param aName The name of the field
       
    87      */
       
    88     void setName(const QString aName); 
       
    89 
       
    90     /**
       
    91      * Setter: Sets the Value of the field.
       
    92      * @param aValue The value of the field
       
    93      */
       
    94     void setValue(const QString aValue);
       
    95 
       
    96     /**
       
    97      * Setter: Sets the Name of the field.
       
    98      * @param aConfig The config of the field
       
    99      */
       
   100     void setConfig(const int aConfig);
       
   101 
       
   102 private:
       
   103 	/**
       
   104      * Constructor.
       
   105      * Creates a CpixDocumentField object and return a pointer to the created object.
       
   106      * @param aName Name of the field
       
   107      * @param aValue Value of the field
       
   108      * @param aConfig Config for the field
       
   109      * @return A pointer to the created instance of CpixDocumentField.
       
   110      */
       
   111     CpixDocumentField(const QString aName, const QString aValue, const int aConfig);
       
   112 
       
   113 private:
       
   114     CpixDocumentFieldPrivate* const iPvtImpl;
       
   115 	Q_DECLARE_PRIVATE_D( iPvtImpl, CpixDocumentField )
       
   116     };		
       
   117 
       
   118 #endif //_CPIXDOCUMENTFIELD_H