controlpanelui/src/tonefetcher/tonefetcherengine/tonefetcherengine.h
changeset 19 36aa4756ee82
child 17 4a9568303383
child 21 2883a5458389
equal deleted inserted replaced
12:624337f114fe 19:36aa4756ee82
       
     1 /*
       
     2  * Copyright (c) 2009 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  *     The header file for tone fetcher engine.
       
    16  *     
       
    17  */
       
    18 
       
    19 #ifndef TONEFETCHERENGINE_H
       
    20 #define TONEFETCHERENGINE_H
       
    21 #include <QObject>
       
    22 #include "toneselectionengine_p.h"
       
    23 #include <QStringList>
       
    24 class TonePreviewPrivate;
       
    25 class ToneSelectionEnginePrivate;
       
    26 
       
    27 // CLASS DECLARATION
       
    28 /**
       
    29  *  This class is used for interacting with platform based codes
       
    30  *  including fetching tones from MDE (Metadata Engine) and previewing tones
       
    31  *  using platform-dependant interface.
       
    32  *
       
    33  */
       
    34 class  ToneFetcherEngine : public QObject
       
    35 {
       
    36     Q_OBJECT
       
    37     
       
    38 public:
       
    39     enum TMediaFileListAttribute {
       
    40         // max media file size
       
    41         EAttrFileSize = 0,
       
    42         // ringing volume (TProfileRingingVolume from Profile.hrh)
       
    43         EAttrVolume,
       
    44         // ringing type,  (TProfileRingingType from Profile.hrh)
       
    45         EAttrRingingType,
       
    46         // vibra on/off   (Boolean) 
       
    47         EAttrVibra,
       
    48         // 3D effect      (TProfile3DToneEffect from ProfileInternal.hrh)
       
    49         EAttr3DEffect,
       
    50         // 3D echo        (TProfile3DToneEcho from ProfileInternal.hrh)
       
    51         EAttr3DEcho,
       
    52         // excluded mime type text
       
    53         EAttrExcludeMimeType,
       
    54         // for file protection checking
       
    55         EAttrAutomatedType,
       
    56         // media file dialog title
       
    57         EAttrTitle,
       
    58         // excluded folder (see enum TFolderType)
       
    59         EAttrExcludeFolder
       
    60     };
       
    61     
       
    62     enum State {
       
    63     SessionConnected = 0,
       
    64     SessionError    
       
    65     };
       
    66     
       
    67     enum TPreviewEvent {         
       
    68         EAudioPreviewComplete, 
       
    69         EPreviewError
       
    70     };
       
    71     explicit ToneFetcherEngine( QObject* parent = 0 );
       
    72     ~ToneFetcherEngine();
       
    73     /*
       
    74      * search the tone using MDE, not including rom files.
       
    75      */
       
    76     void getTone();
       
    77     
       
    78     /*
       
    79      * preview the tone
       
    80      * @param file the absolute path of the file.
       
    81      */
       
    82     void preview(const QString &file);
       
    83     
       
    84     bool IsPlaying();
       
    85 signals:
       
    86     void mdeSessionOpened();
       
    87     void mdeSessionError(int error);
       
    88     void queryComplete(const QStringList &nameList, const QStringList &uriList);
       
    89     void queryError(int error);
       
    90     void notifyPreviewEvent(ToneFetcherEngine::TPreviewEvent event, int errorId);
       
    91     void notifyObjectChanged();
       
    92 private:
       
    93     ToneSelectionEnginePrivate *d;
       
    94     TonePreviewPrivate *mAudioPlayer;
       
    95 };
       
    96 #endif