haiku-dumber/MainWindow.h

67 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 <MenuField.h>
#include <MenuItem.h>
#include <MessageRunner.h>
#include <PopUpMenu.h>
#include <StatusBar.h>
#include <String.h>
#include <TextControl.h>
#include <TextView.h>
#include <Window.h>
#include "Conversation.h"
class MainWindow : public BWindow {
public:
MainWindow();
virtual ~MainWindow();
virtual void MessageReceived(BMessage *msg);
// Overriding FrameResized to receive notifications on resize
void FrameResized(float newWidth, float newHeight) override {
//printf("Window resized to: Width = %f, Height = %f\n", newWidth, newHeight);
// Resize the scroll view if necessary, otherwise we lose scroll ability
}
Conversation *_conversation = new Conversation(this);
void checkValidKey();
void updateHistoryInfo();
private:
std::string lastJSON;
void ShowMissingKeyAlertAndQuit();
void SelectModelByName(const char *targetLabel);
bool waitMode = false;
BMenuBar *_BuildMenu();
BTextView *_answerView;
BScrollView *_answerScrollView;
BTextView *_infoConversation;
BTextView *_infoView;
BTextView *_inputField;
BStatusBar *_progress;
BMenuField *_modelField;
BPopUpMenu *_modelMenu;
BButton *_sendButton;
BMessage *settings;
// BMenuItem *fSaveMenuItem;
};
#endif