radioapp/radiowidgets/inc/radiofrequencystripdef.h
branchRCL_3
changeset 19 cce62ebc198e
equal deleted inserted replaced
18:1a6714c53019 19:cce62ebc198e
       
     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 *
       
    16 */
       
    17 
       
    18 #ifndef RADIOFREQUENCYSTRIPDEF_H
       
    19 #define RADIOFREQUENCYSTRIPDEF_H
       
    20 
       
    21 #include <QLatin1String>
       
    22 #include <QFont>
       
    23 
       
    24 namespace Scroll
       
    25 {
       
    26     enum Direction
       
    27     {
       
    28         Shortest,
       
    29         Left,
       
    30         Right
       
    31     };
       
    32 }
       
    33 
       
    34 namespace FrequencyStrip
       
    35 {
       
    36 
       
    37     struct StationMarker
       
    38     {
       
    39         StationMarker() : mFrequency( 0 ), mIsFavorite( false ) {}
       
    40         StationMarker( uint frequency, bool isFavorite ) : mFrequency( frequency ), mIsFavorite( isFavorite ) {}
       
    41         uint mFrequency;
       
    42         bool mIsFavorite;
       
    43     };
       
    44 
       
    45     enum FrequencyChangeReason
       
    46     {
       
    47         Unspecified = 0,
       
    48         ManualSeekUpdate,
       
    49         ManualSeekTune
       
    50     };
       
    51 
       
    52     // Frequency lines
       
    53     const int TAB_HEIGHT_SMALL = 12;
       
    54     const int TAB_HEIGHT_BIG = 18;
       
    55     const int PEN_WIDTH_FAVORITE = 4;
       
    56     const qreal INDICATOR_WIDTH = 2.0;
       
    57 
       
    58     const qreal ROUNDER = 0.5;
       
    59     const int SELECTOR_WIDTH = 2;
       
    60     const int SELECTOR_Z_POS = 100;
       
    61 
       
    62     const int ONE_HERTZ = 1000000;
       
    63     const int HALF_HERTZ = ONE_HERTZ / 2;
       
    64     const int ONE_TAB_DISTANCE = 20;
       
    65     const uint ONE_TAB_IN_HZ = uint( 0.2 * ONE_HERTZ );
       
    66     const qreal PIXEL_IN_HZ = ONE_TAB_IN_HZ / ONE_TAB_DISTANCE;
       
    67     const qreal PIXMAP_OVERLAP = qreal( ONE_TAB_DISTANCE ) / 2;
       
    68     const int ITEM_WIDTH = ONE_TAB_DISTANCE * 5;
       
    69     const int PIXMAP_WIDTH = ITEM_WIDTH + (int)PIXMAP_OVERLAP;
       
    70 
       
    71     const uint ONE_HUNDRED_KHZ = 100000;
       
    72 
       
    73     static const QLatin1String DECIMAL_TEXT( ".0" );
       
    74 
       
    75     #ifdef BUILD_WIN32
       
    76         const int FREQUENCY_FONT_SIZE = 12;
       
    77         const int DECIMAL_FONT_SIZE = 8;
       
    78     #else
       
    79         const int FREQUENCY_FONT_SIZE = 6;
       
    80         const int DECIMAL_FONT_SIZE = 4;
       
    81     #endif // BUILD_WIN32
       
    82 
       
    83     const QFont FREQUENCY_FONT( "", FREQUENCY_FONT_SIZE );
       
    84     const QFont DECIMAL_FONT( "", DECIMAL_FONT_SIZE );
       
    85     const int FREQUENCY_TEXT_Y_POS = 35;
       
    86     const int STATION_MARKER_Y_POS = 10;
       
    87 
       
    88     static const QLatin1String SLIDE_TO_LEFT    ( "SlideToLeft" );
       
    89     static const QLatin1String SLIDE_FROM_LEFT  ( "SlideFromLeft" );
       
    90     static const QLatin1String SLIDE_TO_RIGHT   ( "SlideToRight" );
       
    91     static const QLatin1String SLIDE_FROM_RIGHT ( "SlideFromRight" );
       
    92     static const QLatin1String LEFT_BUTTON      ( "tv:left_button" );
       
    93     static const QLatin1String RIGHT_BUTTON     ( "tv:right_button" );
       
    94 
       
    95     static const QLatin1String TEXT_COLOR_ATTRIBUTE( "text" );
       
    96     const int MANUALSEEK_START_TIMEOUT = 400;
       
    97     const int MANUALSEEK_END_TIMEOUT = 2000;
       
    98     const int MANUALSEEK_SIGNAL_DELAY = 300;
       
    99 
       
   100 }
       
   101 
       
   102 #endif // RADIOFREQUENCYSTRIPDEF_H