aissia/src/shared/platform/IWindowTracker.hpp
StillHammer d17ee5fbdc feat: AISSIA rename and codebase updates
- Renamed project from Celuna to AISSIA
- Updated all documentation and configuration files
- Codebase improvements and fixes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 18:37:13 +07:00

67 lines
1.7 KiB
C++

#pragma once
#include <string>
#include <memory>
namespace celuna {
/**
* @brief Interface for window tracking across platforms
*
* Implementations:
* - Win32WindowTracker: Windows (GetForegroundWindow)
* - X11WindowTracker: Linux with X11
* - StubWindowTracker: Fallback for unsupported platforms
*/
class IWindowTracker {
public:
virtual ~IWindowTracker() = default;
/**
* @brief Get the name of the currently focused application
* @return Application/process name (e.g., "Code", "firefox")
*/
virtual std::string getCurrentAppName() = 0;
/**
* @brief Get the title of the currently focused window
* @return Window title string
*/
virtual std::string getCurrentWindowTitle() = 0;
/**
* @brief Check if user has been idle (no input) for given threshold
* @param thresholdSeconds Seconds of inactivity to consider idle
* @return true if user is idle
*/
virtual bool isUserIdle(int thresholdSeconds) = 0;
/**
* @brief Get idle time in seconds
* @return Seconds since last user input
*/
virtual int getIdleTimeSeconds() = 0;
/**
* @brief Check if this tracker is functional on current platform
* @return true if tracking is available
*/
virtual bool isAvailable() const = 0;
/**
* @brief Get platform name
* @return Platform identifier (e.g., "win32", "x11", "stub")
*/
virtual std::string getPlatformName() const = 0;
};
/**
* @brief Factory to create appropriate tracker for current platform
*/
class WindowTrackerFactory {
public:
static std::unique_ptr<IWindowTracker> create();
};
} // namespace celuna