summary refs log tree commit diff
path: root/include/emoji
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-07-17 16:37:25 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-07-17 16:37:25 +0300
commit0e814da91c8e041897a4c3f7e6e9234bbc7c6f7a (patch)
tree21f655d30630fe77ba48d07e4b357e2b6c6a5730 /include/emoji
parentMerge pull request #372 from bebehei/notification (diff)
downloadnheko-0e814da91c8e041897a4c3f7e6e9234bbc7c6f7a.tar.xz
Move all files under src/
Diffstat (limited to 'include/emoji')
-rw-r--r--include/emoji/Category.h59
-rw-r--r--include/emoji/ItemDelegate.h43
-rw-r--r--include/emoji/Panel.h66
-rw-r--r--include/emoji/PickButton.h53
-rw-r--r--include/emoji/Provider.h45
5 files changed, 0 insertions, 266 deletions
diff --git a/include/emoji/Category.h b/include/emoji/Category.h
deleted file mode 100644

index a14029c8..00000000 --- a/include/emoji/Category.h +++ /dev/null
@@ -1,59 +0,0 @@ -/* - * nheko Copyright (C) 2017 Konstantinos Sideris <siderisk@auth.gr> - * - * 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 3 of the License, 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. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#pragma once - -#include <QLabel> -#include <QLayout> -#include <QListView> -#include <QStandardItemModel> - -#include "ItemDelegate.h" - -namespace emoji { - -class Category : public QWidget -{ - Q_OBJECT - -public: - Category(QString category, std::vector<Emoji> emoji, QWidget *parent = nullptr); - -signals: - void emojiSelected(const QString &emoji); - -protected: - void paintEvent(QPaintEvent *event) override; - -private slots: - void clickIndex(const QModelIndex &index) - { - emit emojiSelected(index.data(Qt::UserRole).toString()); - }; - -private: - QVBoxLayout *mainLayout_; - - QStandardItemModel *itemModel_; - QListView *emojiListView_; - - emoji::Emoji *data_; - emoji::ItemDelegate *delegate_; - - QLabel *category_; -}; -} // namespace emoji diff --git a/include/emoji/ItemDelegate.h b/include/emoji/ItemDelegate.h deleted file mode 100644
index e0456308..00000000 --- a/include/emoji/ItemDelegate.h +++ /dev/null
@@ -1,43 +0,0 @@ -/* - * nheko Copyright (C) 2017 Konstantinos Sideris <siderisk@auth.gr> - * - * 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 3 of the License, 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. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#pragma once - -#include <QModelIndex> -#include <QStandardItemModel> -#include <QStyledItemDelegate> - -#include "Provider.h" - -namespace emoji { - -class ItemDelegate : public QStyledItemDelegate -{ - Q_OBJECT - -public: - explicit ItemDelegate(QObject *parent = nullptr); - ~ItemDelegate(); - - void paint(QPainter *painter, - const QStyleOptionViewItem &option, - const QModelIndex &index) const override; - -private: - Emoji *data_; -}; -} // namespace emoji diff --git a/include/emoji/Panel.h b/include/emoji/Panel.h deleted file mode 100644
index ad233c27..00000000 --- a/include/emoji/Panel.h +++ /dev/null
@@ -1,66 +0,0 @@ -/* - * nheko Copyright (C) 2017 Konstantinos Sideris <siderisk@auth.gr> - * - * 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 3 of the License, 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. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#pragma once - -#include <QScrollArea> - -#include "Provider.h" - -namespace emoji { - -class Category; - -class Panel : public QWidget -{ - Q_OBJECT - -public: - Panel(QWidget *parent = nullptr); - -signals: - void mouseLeft(); - void emojiSelected(const QString &emoji); - -protected: - void leaveEvent(QEvent *event) override - { - emit leaving(); - QWidget::leaveEvent(event); - } - - void paintEvent(QPaintEvent *event) override; - -signals: - void leaving(); - -private: - void showCategory(const Category *category); - - Provider emoji_provider_; - - QScrollArea *scrollArea_; - - int shadowMargin_; - - // Panel dimensions. - int width_; - int height_; - - int categoryIconSize_; -}; -} // namespace emoji diff --git a/include/emoji/PickButton.h b/include/emoji/PickButton.h deleted file mode 100644
index 9117e61f..00000000 --- a/include/emoji/PickButton.h +++ /dev/null
@@ -1,53 +0,0 @@ -/* - * nheko Copyright (C) 2017 Konstantinos Sideris <siderisk@auth.gr> - * - * 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 3 of the License, 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. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#pragma once - -#include <QEvent> -#include <QTimer> -#include <QWidget> - -#include "FlatButton.h" - -namespace emoji { - -class Panel; - -class PickButton : public FlatButton -{ - Q_OBJECT -public: - explicit PickButton(QWidget *parent = nullptr); - -signals: - void emojiSelected(const QString &emoji); - -protected: - void enterEvent(QEvent *e) override; - void leaveEvent(QEvent *e) override; - -private: - // Vertical distance from panel's bottom. - int vertical_distance_ = 10; - - // Horizontal distance from panel's bottom right corner. - int horizontal_distance_ = 70; - - QSharedPointer<Panel> panel_; - QTimer hideTimer_; -}; -} // namespace emoji diff --git a/include/emoji/Provider.h b/include/emoji/Provider.h deleted file mode 100644
index 5cc3ced4..00000000 --- a/include/emoji/Provider.h +++ /dev/null
@@ -1,45 +0,0 @@ -/* - * nheko Copyright (C) 2017 Konstantinos Sideris <siderisk@auth.gr> - * - * 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 3 of the License, 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. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#pragma once - -#include <QString> -#include <vector> - -namespace emoji { - -struct Emoji -{ - // Unicode code. - QString unicode; - // Keyboard shortcut e.g :emoji: - QString shortname; -}; - -class Provider -{ -public: - static const std::vector<Emoji> people; - static const std::vector<Emoji> nature; - static const std::vector<Emoji> food; - static const std::vector<Emoji> activity; - static const std::vector<Emoji> travel; - static const std::vector<Emoji> objects; - static const std::vector<Emoji> symbols; - static const std::vector<Emoji> flags; -}; -} // namespace emoji