You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
1.9 KiB

#ifndef JUCI_SOURCE_H_
#define JUCI_SOURCE_H_
11 years ago
#include <unordered_map>
#include <vector>
#include <string>
#include "gtkmm.h"
#include <TranslationUnit.h>
11 years ago
using std::string;
namespace Source {
11 years ago
class Config() {
// læs json
//
private:
}
class Config {
11 years ago
public:
const std::unordered_map<string, string>& tagtable() const;
11 years ago
const std::unordered_map<string, string>& typetable() const;
11 years ago
void SetTagTable(const std::unordered_map<string, string> &tagtable);
void InsertTag(const string &key, const string &value);
11 years ago
void SetTypeTable(const std::unordered_map<string, string> &tagtable);
void InsertType(const string &key, const string &value);
11 years ago
private:
std::unordered_map<string, string> tagtable_;
11 years ago
std::unordered_map<string, string> typetable_;
11 years ago
string background_;
}; // class Theme
class View : public Gtk::TextView {
public:
View();
11 years ago
string UpdateLine();
void ApplyTheme(const Theme &theme);
void OnOpenFile(std::vector<Clang::SourceLocation> &locations,
const Theme &theme);
private:
11 years ago
string GetLine(const Gtk::TextIter &begin);
}; // class View
class Model{
public:
Model();
Theme& theme();
11 years ago
const string filepath();
void SetFilePath(const string &filepath);
11 years ago
void SetSourceLocations(
const std::vector<Clang::SourceLocation> &locations);
std::vector<Clang::SourceLocation>& getSourceLocations() {
return locations_;
}
11 years ago
private:
Theme theme_;
string filepath_;
std::vector<Clang::SourceLocation> locations_;
};
class Controller {
public:
Controller();
View& view();
Model& model();
void OnNewEmptyFile();
void OnOpenFile(const string &filename);
Glib::RefPtr<Gtk::TextBuffer> buffer();
private:
11 years ago
void OnLineEdit();
void OnSaveFile();
protected:
View view_;
Model model_;
}; // class Controller
} // namespace Source
#endif // JUCI_SOURCE_H_