summaryrefslogtreecommitdiffstats
path: root/src/libs/imageproperties/navigatebarwidget.cpp
blob: 9232c55e6c0b3e9b804217c222f152b7a8467b6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/* ============================================================
 *
 * This file is a part of digiKam project
 * http://www.digikam.org
 *
 * Date        : 2005-07-07
 * Description : a navigate bar with text 
 * 
 * Copyright (C) 2005-2007 by Gilles Caulier <caulier dot gilles at gmail dot com>
 *
 * This program is free software; you can redistribute it
 * and/or modify it under the terms of the GNU General
 * Public License as published by the Free Software Foundation;
 * either version 2, or (at your option)
 * any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * ============================================================ */

// TQt includes.

#include <tqlayout.h>

// KDE includes.

#include <ksqueezedtextlabel.h>
#include <kdialogbase.h>
#include <tdelocale.h>

// Local includes.

#include "statusnavigatebar.h"
#include "navigatebarwidget.h"
#include "navigatebarwidget.moc"

namespace Digikam
{

class NavigateBarWidgetPriv
{
public:

    NavigateBarWidgetPriv()
    {
        filename = 0;
        navBar   = 0;
    }
    
    KSqueezedTextLabel *filename;

    StatusNavigateBar  *navBar;
};

NavigateBarWidget::NavigateBarWidget(TQWidget *parent, bool show)
                 : TQWidget(parent, 0, TQt::WDestructiveClose)
{
    d = new NavigateBarWidgetPriv;
    
    TQHBoxLayout *lay = new TQHBoxLayout(this);
    d->navBar   = new StatusNavigateBar(this);    
    d->filename = new KSqueezedTextLabel(this);
    
    lay->addWidget(d->navBar);
    lay->addSpacing( KDialog::spacingHint() );
    lay->addWidget(d->filename);

    if (!show) hide();
    
    connect(d->navBar, TQ_SIGNAL(signalFirstItem()),
            this, TQ_SIGNAL(signalFirstItem()));
    
    connect(d->navBar, TQ_SIGNAL(signalPrevItem()),
            this, TQ_SIGNAL(signalPrevItem()));
    
    connect(d->navBar, TQ_SIGNAL(signalNextItem()),
            this, TQ_SIGNAL(signalNextItem()));
    
    connect(d->navBar, TQ_SIGNAL(signalLastItem()),
            this, TQ_SIGNAL(signalLastItem()));
}      

NavigateBarWidget::~NavigateBarWidget()
{
    delete d;
}

void NavigateBarWidget::setFileName(TQString filename)
{
    d->filename->setText(filename);
}

TQString NavigateBarWidget::getFileName()
{
    return (d->filename->text());
}

void NavigateBarWidget::setButtonsState(int itemType)
{
    d->navBar->setButtonsState(itemType);
}

int NavigateBarWidget::getButtonsState()
{
    return (d->navBar->getButtonsState());
}

}  // namespace Digikam