mirror-chatterino2/src/widgets/notebook.hpp
Rasmus Karlsson 3bf111a091 More progress on tab-complete
There are missing parts to the "account-based" emotes that needs to be
completed before emote completion can be considered done. For now, when
I've been testing, I've been manually injecting the oauthClient and
oauthToken to the settings file with the `user_subscriptions` scope
2017-07-23 14:16:13 +02:00

76 lines
1.5 KiB
C++

#pragma once
#include "widgets/basewidget.hpp"
#include "widgets/notebookbutton.hpp"
#include "widgets/notebookpage.hpp"
#include "widgets/notebooktab.hpp"
#include <QList>
#include <QWidget>
#include <boost/property_tree/ptree.hpp>
namespace chatterino {
class ChannelManager;
class CompletionManager;
namespace widgets {
class MainWindow;
class Notebook : public BaseWidget
{
Q_OBJECT
public:
enum HighlightType { none, highlighted, newMessage };
explicit Notebook(ChannelManager &_channelManager, MainWindow *parent);
NotebookPage *addPage(bool select = false);
void removePage(NotebookPage *page);
void select(NotebookPage *page);
NotebookPage *getSelectedPage()
{
return selectedPage;
}
void performLayout(bool animate = true);
NotebookPage *tabAt(QPoint point, int &index);
void rearrangePage(NotebookPage *page, int index);
protected:
void resizeEvent(QResizeEvent *);
void settingsButtonMouseReleased(QMouseEvent *event);
public slots:
void settingsButtonClicked();
void usersButtonClicked();
void addPageButtonClicked();
public:
ChannelManager &channelManager;
CompletionManager &completionManager;
private:
QList<NotebookPage *> pages;
NotebookButton addButton;
NotebookButton settingsButton;
NotebookButton userButton;
NotebookPage *selectedPage;
public:
void load(const boost::property_tree::ptree &tree);
void save(boost::property_tree::ptree &tree);
void loadDefaults();
};
} // namespace widgets
} // namespace chatterino