|
Shinya Kitaoka |
810553 |
#pragma once
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#ifndef TW_MESSAGE_INCLUDED
|
|
Toshihiro Shimizu |
890ddd |
#define TW_MESSAGE_INCLUDED
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#include "tcommon.h"
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#undef DVAPI
|
|
Toshihiro Shimizu |
890ddd |
#undef DVVAR
|
|
Toshihiro Shimizu |
890ddd |
#ifdef TWIN_EXPORTS
|
|
Toshihiro Shimizu |
890ddd |
#define DVAPI DV_EXPORT_API
|
|
Toshihiro Shimizu |
890ddd |
#define DVVAR DV_EXPORT_VAR
|
|
Toshihiro Shimizu |
890ddd |
#else
|
|
Toshihiro Shimizu |
890ddd |
#define DVAPI DV_IMPORT_API
|
|
Toshihiro Shimizu |
890ddd |
#define DVVAR DV_IMPORT_VAR
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class TFilePath;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
namespace TMessage {
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
class DVAPI Arg {
|
|
Shinya Kitaoka |
120a6e |
TString m_arg;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
/*
|
|
Toshihiro Shimizu |
890ddd |
#if defined(MACOSX)
|
|
Shinya Kitaoka |
120a6e |
Arg(const string &arg) {}
|
|
Shinya Kitaoka |
120a6e |
Arg(const wstring &arg) {}
|
|
Shinya Kitaoka |
120a6e |
Arg(const TFilePath &arg){}
|
|
Toshihiro Shimizu |
890ddd |
#else
|
|
Toshihiro Shimizu |
890ddd |
*/
|
|
Shinya Kitaoka |
120a6e |
Arg(const string &arg);
|
|
Shinya Kitaoka |
120a6e |
Arg(const wstring &arg);
|
|
Shinya Kitaoka |
120a6e |
Arg(const TFilePath &arg);
|
|
Shinya Kitaoka |
120a6e |
/*#endif*/
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
TString getString() const { return m_arg; }
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#ifdef WIN32
|
|
Toshihiro Shimizu |
890ddd |
#pragma warning(push)
|
|
Toshihiro Shimizu |
890ddd |
#pragma warning(disable : 4251)
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
class DVAPI ArgList {
|
|
Shinya Kitaoka |
120a6e |
vector<arg> m_args;</arg>
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
ArgList() {}
|
|
Shinya Kitaoka |
120a6e |
ArgList(const Arg &arg) { m_args.push_back(arg); }
|
|
Shinya Kitaoka |
120a6e |
ArgList(const Arg &arg0, const Arg &arg1) {
|
|
Shinya Kitaoka |
120a6e |
m_args.push_back(arg0);
|
|
Shinya Kitaoka |
120a6e |
m_args.push_back(arg1);
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
ArgList(const Arg &arg0, const Arg &arg1, const Arg &arg2) {
|
|
Shinya Kitaoka |
120a6e |
m_args.push_back(arg0);
|
|
Shinya Kitaoka |
120a6e |
m_args.push_back(arg1);
|
|
Shinya Kitaoka |
120a6e |
m_args.push_back(arg2);
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
int getCount() const { return m_args.size(); }
|
|
Shinya Kitaoka |
120a6e |
TString getString(int index) const {
|
|
Shinya Kitaoka |
120a6e |
assert(0 <= index && index < getCount());
|
|
Shinya Kitaoka |
120a6e |
return m_args[index].getString();
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#ifdef WIN32
|
|
Toshihiro Shimizu |
890ddd |
#pragma warning(pop)
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
enum Answer { NO = 0, YES = 1, CANCEL = -1 };
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
/*
|
|
Toshihiro Shimizu |
890ddd |
#if defined(MACOSX)
|
|
Toshihiro Shimizu |
890ddd |
DVAPI void error(const string &str, const ArgList &lst){}
|
|
Toshihiro Shimizu |
890ddd |
DVAPI Answer question(const string &str, const ArgList &lst);
|
|
Toshihiro Shimizu |
890ddd |
DVAPI Answer yesNoCancel(const string &str, const ArgList &lst);
|
|
Toshihiro Shimizu |
890ddd |
#else
|
|
Toshihiro Shimizu |
890ddd |
*/
|
|
Toshihiro Shimizu |
890ddd |
DVAPI void error(const string &str, const ArgList &lst);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
DVAPI void info(const string &str, const ArgList &lst);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
DVAPI Answer question(const string &str, const ArgList &lst);
|
|
Toshihiro Shimizu |
890ddd |
DVAPI Answer yesNoCancel(const string &str, const ArgList &lst);
|
|
Toshihiro Shimizu |
890ddd |
//#endif
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
inline void info(const string &str) { info(str, ArgList()); }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
inline void error(const string &str) { error(str, ArgList()); }
|
|
Shinya Kitaoka |
120a6e |
inline void error(const string &str, const Arg &arg0) {
|
|
Shinya Kitaoka |
120a6e |
error(str, ArgList(arg0));
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Shinya Kitaoka |
120a6e |
inline void error(const string &str, const Arg &arg0, const Arg &arg1) {
|
|
Shinya Kitaoka |
120a6e |
error(str, ArgList(arg0, arg1));
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Shinya Kitaoka |
120a6e |
inline void error(const string &str, const Arg &arg0, const Arg &arg1,
|
|
Shinya Kitaoka |
120a6e |
const Arg &arg2) {
|
|
Shinya Kitaoka |
120a6e |
error(str, ArgList(arg0, arg1, arg2));
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
inline Answer question(const string &str) { return question(str, ArgList()); }
|
|
Shinya Kitaoka |
120a6e |
inline Answer question(const string &str, const Arg &arg0) {
|
|
Shinya Kitaoka |
120a6e |
return question(str, ArgList(arg0));
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Shinya Kitaoka |
120a6e |
inline Answer question(const string &str, const Arg &arg0, const Arg &arg1) {
|
|
Shinya Kitaoka |
120a6e |
return question(str, ArgList(arg0, arg1));
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Shinya Kitaoka |
120a6e |
inline Answer question(const string &str, const Arg &arg0, const Arg &arg1,
|
|
Shinya Kitaoka |
120a6e |
const Arg &arg2) {
|
|
Shinya Kitaoka |
120a6e |
return question(str, ArgList(arg0, arg1, arg2));
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
inline Answer yesNoCancel(const string &str) {
|
|
Shinya Kitaoka |
120a6e |
return yesNoCancel(str, ArgList());
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Shinya Kitaoka |
120a6e |
inline Answer yesNoCancel(const string &str, const Arg &arg0) {
|
|
Shinya Kitaoka |
120a6e |
return yesNoCancel(str, ArgList(arg0));
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Shinya Kitaoka |
120a6e |
inline Answer yesNoCancel(const string &str, const Arg &arg0, const Arg &arg1) {
|
|
Shinya Kitaoka |
120a6e |
return yesNoCancel(str, ArgList(arg0, arg1));
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Shinya Kitaoka |
120a6e |
inline Answer yesNoCancel(const string &str, const Arg &arg0, const Arg &arg1,
|
|
Shinya Kitaoka |
120a6e |
const Arg &arg2) {
|
|
Shinya Kitaoka |
120a6e |
return yesNoCancel(str, ArgList(arg0, arg1, arg2));
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
DVAPI int multipleChoicesQuestion(const string &question, const ArgList &argLst,
|
|
Shinya Kitaoka |
120a6e |
std::vector<string> &buttons);</string>
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
} // namespace
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#endif
|