FinceptTerminal is a modern finance application offering advanced market analytics, investment research, and economic data tools, designed for interactive exploration and data-driven decision-making in a user-friendly environment.
C++ ai-agentsalgorithmic-tradingbloomberg-terminalcppfinancefinancial-marketsfintechgood-first-issueinvestmentinvestment-researchmachine-learningopensourcepythonqtquantitative-financestock-markettrading
#pragma once
#include "services/news/NewsCorrelationService.h"
#include "services/news/NewsMonitorService.h"
#include "services/news/NewsNlpService.h"
#include "services/news/NewsService.h"
#include <QEvent>
#include <QLabel>
#include <QLineEdit>
#include <QMap>
#include <QPushButton>
#include <QVBoxLayout>
#include <QWidget>
namespace fincept::screens {
/// Intelligence drawer — slides in from the left over the feed panel.
/// Contains all advanced intelligence sections: monitors, top stories,
/// categories, entities, places, signals, prediction markets, bookmarks.
/// Toggled via the INTEL button in the command bar.
class NewsSidePanel : public QWidget {
Q_OBJECT
public:
explicit NewsSidePanel(QWidget* parent = nullptr);
void update_top_stories(const QVector<services::NewsArticle>& top);
void update_categories(const QMap<QString, int>& counts);
void update_monitors(const QVector<services::NewsMonitor>& monitors,
const QMap<QString, QVector<services::NewsArticle>>& matches);
void update_deviations(const QVector<QPair<QString, double>>& deviations);
void update_entities(const services::NerResult& ner);
void update_locations(const QVector<services::ArticleGeo>& geo);
void update_signals(const QVector<services::CorrelationSignal>& sigs);
void update_predictions(const QVector<services::PredictionMarket>& predictions);
void update_saved(const QVector<services::NewsArticle>& saved);
/// Show / hide the drawer (the screen keeps the INTEL button in sync).
void set_drawer_open(bool open);
bool is_drawer_open() const { return drawer_open_; }
protected:
void changeEvent(QEvent* event) override;
signals:
void category_clicked(const QString& category);
void article_clicked(const services::NewsArticle& article);
void monitor_added(const QString& label, const QStringList& keywords);
void monitor_toggled(const QString& id);
void monitor_deleted(const QString& id);
/// The drawer's own close button was clicked (the screen closes it).
void close_requested();
private:
void build_top_stories_section(QVBoxLayout* parent);
void build_categories_section(QVBoxLayout* parent);
void build_monitors_section(QVBoxLayout* parent);
void build_deviations_section(QVBoxLayout* parent);
/// Re-apply tr() lookups to every widget whose text we keep a handle to.
/// Called from changeEvent() on QEvent::LanguageChange.
void retranslateUi();
bool drawer_open_ = false;
// Header + fixed section titles (cached for retranslateUi).
QLabel* drawer_title_ = nullptr;
QLabel* top_stories_title_ = nullptr;
QLabel* categories_title_ = nullptr;
QLabel* monitors_title_ = nullptr;
QLabel* deviations_title_ = nullptr;
QLabel* entities_title_ = nullptr;
QLabel* locations_title_ = nullptr;
QLabel* signals_title_ = nullptr;
QLabel* predictions_title_ = nullptr;
QLabel* saved_title_ = nullptr;
// Top stories
QVBoxLayout* top_stories_layout_ = nullptr;
// Categories
QVBoxLayout* categories_layout_ = nullptr;
// Monitors
QVBoxLayout* monitors_layout_ = nullptr;
QLineEdit* monitor_input_ = nullptr;
// Deviations
QVBoxLayout* deviations_layout_ = nullptr;
QWidget* deviations_section_ = nullptr;
// Entities (NER)
QVBoxLayout* entities_layout_ = nullptr;
QWidget* entities_section_ = nullptr;
// Locations
QVBoxLayout* locations_layout_ = nullptr;
QWidget* locations_section_ = nullptr;
// Correlation signals
QVBoxLayout* signals_layout_ = nullptr;
QWidget* signals_section_ = nullptr;
// Prediction markets
QVBoxLayout* predictions_layout_ = nullptr;
QWidget* predictions_section_ = nullptr;
QLabel* predictions_source_ = nullptr; // "Manifold Markets (play money)" disclosure
// Saved / bookmarked articles
QVBoxLayout* saved_layout_ = nullptr;
QWidget* saved_section_ = nullptr;
};
} // namespace fincept::screens