70 lines
1.4 KiB
C++
70 lines
1.4 KiB
C++
/*
|
|
* Copyright 2024, My Name <my@email.address>
|
|
* All rights reserved. Distributed under the terms of the MIT license.
|
|
*/
|
|
#ifndef MAINWINDOW_H
|
|
#define MAINWINDOW_H
|
|
|
|
#include <MenuItem.h>
|
|
#include <TextControl.h>
|
|
#include <TextView.h>
|
|
#include <StatusBar.h>
|
|
#include <Window.h>
|
|
#include <String.h>
|
|
#include <MessageRunner.h>
|
|
#include <PopUpMenu.h>
|
|
#include <MenuField.h>
|
|
|
|
|
|
#include "Conversation.h"
|
|
|
|
|
|
static const uint32 kCheckKey = 'chkk';
|
|
static const uint32 kMsgNewFile = 'fnew';
|
|
static const uint32 kMsgOpenFile = 'fopn';
|
|
static const uint32 kMsgSaveFile = 'fsav';
|
|
static const uint32 kModelSelected = 'msel';
|
|
|
|
static const uint32 kPulse = 'plse';
|
|
|
|
static const uint32 kSendPrompt = 'kspt';
|
|
static const uint32 kQuestionChanged = 'kqch';
|
|
|
|
|
|
|
|
|
|
|
|
class MainWindow : public BWindow {
|
|
public:
|
|
MainWindow();
|
|
virtual ~MainWindow();
|
|
|
|
virtual void MessageReceived(BMessage *msg);
|
|
|
|
Conversation* _conversation = new Conversation(this);
|
|
|
|
void checkValidKey();
|
|
|
|
void updateHistoryInfo();
|
|
|
|
|
|
private:
|
|
|
|
void ShowMissingKeyAlertAndQuit();
|
|
void SelectModelByName(const char* targetLabel);
|
|
|
|
bool waitMode = false;
|
|
BMenuBar *_BuildMenu();
|
|
BTextView * _answerView;
|
|
BTextView * _infoConversation;
|
|
BTextView * _infoView;
|
|
BTextView* _inputField;
|
|
BStatusBar* _progress;
|
|
BMenuField* _modelField;
|
|
BPopUpMenu* _modelMenu;
|
|
BButton *_sendButton;
|
|
|
|
// BMenuItem *fSaveMenuItem;
|
|
};
|
|
|
|
#endif
|