Warning, file /sdk/lokalize/src/alttransview.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002   This file is part of Lokalize
0003 
0004   SPDX-FileCopyrightText: 2007-2008 Nick Shaforostoff <shafff@ukr.net>
0005   SPDX-FileCopyrightText: 2018-2019 Simon Depiets <sdepiets@gmail.com>
0006 
0007   SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0008 */
0009 
0010 #ifndef ALTTRANSVIEW_H
0011 #define ALTTRANSVIEW_H
0012 
0013 #define ALTTRANS_SHORTCUTS 9
0014 
0015 #include "pos.h"
0016 #include "alttrans.h"
0017 #include <QDockWidget>
0018 namespace TM
0019 {
0020 class TextBrowser;
0021 }
0022 class Catalog;
0023 class QAction;
0024 
0025 class AltTransView: public QDockWidget
0026 {
0027     Q_OBJECT
0028 
0029 public:
0030     explicit AltTransView(QWidget*, Catalog*, const QVector<QAction*>&);
0031     ~AltTransView() override;
0032 
0033 
0034 public Q_SLOTS:
0035     void slotNewEntryDisplayed(const DocPosition&);
0036     void fileLoaded();
0037     void attachAltTransFile(const QString&);
0038     void addAlternateTranslation(int entry, const QString&);
0039 
0040 private Q_SLOTS:
0041     //void contextMenu(const QPoint & pos);
0042     void process();
0043     void initLater();
0044     void slotUseSuggestion(int);
0045 
0046 Q_SIGNALS:
0047     void refreshRequested();
0048     void textInsertRequested(const QString&);
0049 
0050 private:
0051     void dragEnterEvent(QDragEnterEvent* event) override;
0052     void dropEvent(QDropEvent *event) override;
0053     bool event(QEvent *event) override;
0054 
0055 
0056 private:
0057     TM::TextBrowser* m_browser;
0058     Catalog* m_catalog;
0059     QString m_normTitle;
0060     QString m_hasInfoTitle;
0061     bool m_hasInfo;
0062     bool m_everShown;
0063     DocPos m_entry;
0064     DocPos m_prevEntry;
0065 
0066     QVector<AltTrans> m_entries;
0067     QMap<int, int> m_entryPositions;
0068     QVector<QAction*> m_actions;//need them to get shortcuts
0069 };
0070 
0071 #endif