2021-07-08 16:07:03 -05:00
|
|
|
/*
|
|
|
|
* Copyright 2021, Jaidyn Levesque <jadedctrl@teknik.io>
|
|
|
|
* All rights reserved. Distributed under the terms of the MIT license.
|
|
|
|
*/
|
|
|
|
#ifndef _SEND_TEXT_VIEW_H
|
|
|
|
#define _SEND_TEXT_VIEW_H
|
|
|
|
|
2021-07-31 18:50:04 -05:00
|
|
|
#include <StringList.h>
|
|
|
|
#include <TextView.h>
|
2021-07-08 16:07:03 -05:00
|
|
|
|
|
|
|
#include "ConversationView.h"
|
|
|
|
|
|
|
|
|
2021-07-31 18:50:04 -05:00
|
|
|
class SendTextView : public BTextView {
|
2021-07-08 16:07:03 -05:00
|
|
|
public:
|
2021-07-31 20:18:36 -05:00
|
|
|
SendTextView(const char* name, ConversationView* convView);
|
2021-07-08 16:07:03 -05:00
|
|
|
|
2021-07-31 20:18:36 -05:00
|
|
|
virtual void KeyDown(const char* bytes, int32 numBytes);
|
2021-07-08 16:07:03 -05:00
|
|
|
|
|
|
|
private:
|
2021-07-31 20:18:36 -05:00
|
|
|
void _AutoComplete();
|
|
|
|
const char* _CommandAutoComplete();
|
|
|
|
const char* _UserAutoComplete();
|
2021-07-09 10:39:48 -05:00
|
|
|
|
2021-07-31 20:18:36 -05:00
|
|
|
void _AppendHistory();
|
|
|
|
void _UpHistory();
|
|
|
|
void _DownHistory();
|
2021-07-31 18:50:04 -05:00
|
|
|
|
2021-07-08 16:07:03 -05:00
|
|
|
ConversationView* fConversationView;
|
2021-07-09 10:39:48 -05:00
|
|
|
|
2021-07-31 20:18:36 -05:00
|
|
|
// Used for auto-completion
|
2021-07-09 10:39:48 -05:00
|
|
|
int32 fCurrentIndex;
|
|
|
|
BString fCurrentWord;
|
2021-07-31 18:50:04 -05:00
|
|
|
|
2021-07-31 20:18:36 -05:00
|
|
|
// Used for history
|
2021-07-31 18:50:04 -05:00
|
|
|
BStringList fHistory;
|
|
|
|
int32 fHistoryIndex;
|
2021-07-08 16:07:03 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _SEND_TEXT_VIEW_H
|