summaryrefslogtreecommitdiffstats
path: root/digikam/utilities/lighttable/lighttablebar.h
blob: e6bc2390a7a670c7afc5eee5ccf1120e7a5d5405 (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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
/* ============================================================
 *
 * This file is a part of digiKam project
 * http://www.digikam.org
 *
 * Date        : 2007-04-11
 * Description : light table thumbs bar
 *
 * Copyright (C) 2007-2008 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.
 *
 * ============================================================ */

#ifndef LIGHTTABLEBAR_H
#define LIGHTTABLEBAR_H

// Local includes.

#include "thumbbar.h"
#include "imageinfo.h"
#include "digikam_export.h"

class TQDragMoveEvent;
class TQDropEvent;
class TQMouseEvent;
class TQPaintEvent;

class KURL;

namespace Digikam
{

class LightTableBarItem;
class LightTableBarItemPriv;
class LightTableBarPriv;

class DIGIKAM_EXPORT LightTableBar : public ThumbBarView
{
    Q_OBJECT
  

public:

    LightTableBar(TQWidget* parent, int orientation=Vertical, bool exifRotate=true);
    ~LightTableBar();

    ImageInfo*    currentItemImageInfo() const;
    ImageInfoList itemsImageInfoList();

    void setSelectedItem(LightTableBarItem* ltItem);

    LightTableBarItem* findItemByInfo(const ImageInfo* info) const;
    LightTableBarItem* findItemByPos(const TQPoint& pos) const;

    /** Read tool tip settings from Album Settings instance */
    void readToolTipSettings();

    void setOnLeftPanel(const ImageInfo* info);
    void setOnRightPanel(const ImageInfo* info);

    void removeItem(const ImageInfo* info);

    void setNavigateByPair(bool b);

signals:

    void signalLightTableBarItemSelected(ImageInfo*);
    void signalSetItemOnLeftPanel(ImageInfo*);
    void signalSetItemOnRightPanel(ImageInfo*);
    void signalEditItem(ImageInfo*);
    void signalRemoveItem(ImageInfo*);
    void signalClearAll();
    void signalDroppedItems(const ImageInfoList&);

private:

    void viewportPaintEvent(TQPaintEvent*);    
    void contentsMouseReleaseEvent(TQMouseEvent*);
    void startDrag();
    void contentsDragMoveEvent(TQDragMoveEvent*);
    void contentsDropEvent(TQDropEvent*);

private slots:

    void slotImageRatingChanged(TQ_LLONG);
    void slotItemSelected(ThumbBarItem*);

    void slotAssignRatingNoStar();
    void slotAssignRatingOneStar();
    void slotAssignRatingTwoStar();
    void slotAssignRatingThreeStar();
    void slotAssignRatingFourStar();
    void slotAssignRatingFiveStar();
    void slotAssignRating(int);

    void slotThemeChanged();

private:

    LightTableBarPriv *d;

    friend class LightTableBarItem;
};

// -------------------------------------------------------------------------

class DIGIKAM_EXPORT LightTableBarItem : public ThumbBarItem
{
public:

    LightTableBarItem(LightTableBar *view, ImageInfo *info);
    ~LightTableBarItem();

    ImageInfo* info() const;

    void setOnLeftPanel(bool on);
    void setOnRightPanel(bool on);
    bool isOnLeftPanel() const;
    bool isOnRightPanel() const;
    
private:

    LightTableBarItemPriv *d;

    friend class LightTableBar;
};

// -------------------------------------------------------------------------

class DIGIKAM_EXPORT LightTableBarToolTip : public ThumbBarToolTip
{
public:

    LightTableBarToolTip(ThumbBarView *parent);

private:

    TQString tipContentExtraData(ThumbBarItem *item);
};

}  // NameSpace Digikam

#endif /* LIGHTTABLEBAR_H */